/* Public authentication pages: login, registration and password recovery. */
body.ez-auth-public {
  background: var(--ez-body-bg);
  background-image: none;
  color: var(--ez-text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

.ez-theme-public {
  position: fixed;
  right: 20px;
  top: 16px;
  z-index: 1050;
}

.ez-theme-public .ez-theme-toggle {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  min-width: 38px;
}

.ez-theme-toggle .ez-theme-icon-light,
.ez-theme-toggle .ez-theme-icon-dark {
  display: none;
}

.ez-theme-toggle .ez-theme-icon-light {
  display: inline-block;
}

.ez-auth-shell {
  align-items: center;
  background: var(--ez-body-bg);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 36px 16px;
  position: relative;
  z-index: 1;
}

.ez-auth-card {
  background: var(--ez-surface);
  border: 1px solid var(--ez-border);
  border-radius: 8px;
  box-shadow: var(--ez-shadow-lg);
  max-width: 480px;
  padding: 40px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.ez-auth-card::before {
  background: linear-gradient(90deg, #3f8fd2, #2bbf8f);
  border-radius: 8px 8px 0 0;
  content: '';
  height: 4px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.ez-auth-brand {
  align-items: center;
  background: transparent;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(43, 191, 143, .2);
  display: flex;
  height: 64px;
  justify-content: center;
  margin-bottom: 20px;
  width: 64px;
}

.ez-auth-brand img {
  display: block;
  height: 64px;
  width: 64px;
}

.ez-auth-eyebrow {
  color: #16966e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ez-auth-card h1 {
  color: var(--ez-text-strong);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 8px;
}

.ez-auth-subtitle {
  color: var(--ez-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 28px;
}

.ez-auth-public .form-label {
  color: var(--ez-text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: .5rem;
}

.ez-auth-public .form-control {
  background: var(--ez-surface);
  border: 1px solid var(--ez-control-border);
  border-radius: 8px;
  color: var(--ez-text);
  min-height: 48px;
  padding: .75rem 1.25rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.ez-auth-public .form-control::placeholder {
  color: #64748b;
}

.ez-auth-public .form-control:focus {
  background: var(--ez-surface);
  border-color: var(--ez-focus-border);
  box-shadow: 0 0 0 3px var(--ez-focus-ring);
  color: var(--ez-text-strong);
}

.ez-auth-public .btn-primary {
  align-items: center;
  background: linear-gradient(135deg, #3f8fd2, #2bbf8f);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(43, 191, 143, .22);
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  transition: box-shadow .2s ease, transform .2s ease;
}

.ez-auth-public .btn-primary:hover {
  box-shadow: 0 14px 32px rgba(43, 191, 143, .32);
  transform: translateY(-2px);
}

.ez-auth-links {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
}

.ez-auth-links.is-centered {
  justify-content: center;
}

.ez-auth-links a,
.ez-auth-public .alert a {
  color: #16845f;
  font-weight: 700;
  text-decoration: none;
}

.ez-auth-links a:hover,
.ez-auth-public .alert a:hover {
  color: #116a4d;
  text-decoration: underline;
}

.ez-auth-public .alert {
  border-radius: 14px;
  border-width: 1px;
  font-size: 14px;
  padding: 1rem 1.25rem;
}

.ez-auth-public .alert-danger {
  background: rgba(194, 61, 75, .1);
  border-color: rgba(194, 61, 75, .2);
  color: var(--ez-danger);
}

.ez-auth-public .alert-success {
  background: rgba(22, 132, 95, .1);
  border-color: rgba(22, 132, 95, .2);
  color: var(--ez-success);
}

.ez-auth-public .alert-info {
  background: rgba(63, 143, 210, .1);
  border-color: rgba(63, 143, 210, .2);
  color: #286fa9;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .ez-auth-card {
    padding: 30px 20px;
  }

  .ez-auth-card h1 {
    font-size: 26px;
  }
}

/* Tablet/mobile contract for every public authentication flow. */
@media (max-width: 1199.98px) {
  body.ez-auth-public {
    min-height: 100dvh;
  }

  .ez-auth-shell {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding:
      max(72px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(32px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
  }

  .ez-auth-card {
    max-width: 520px;
  }
}

@media (max-width: 575.98px) {
  .ez-theme-public {
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }

  .ez-theme-public .ez-theme-toggle {
    min-height: 42px;
    min-width: 42px;
  }

  .ez-auth-shell {
    align-items: flex-start;
    padding:
      max(64px, calc(env(safe-area-inset-top) + 52px))
      max(12px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .ez-auth-card {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(31, 41, 55, .1);
    padding: 26px 18px;
  }

  .ez-auth-brand,
  .ez-auth-brand img {
    height: 54px;
    width: 54px;
  }

  .ez-auth-card h1 {
    font-size: clamp(24px, 8vw, 28px);
  }

  .ez-auth-subtitle {
    margin-bottom: 22px;
  }

  .ez-auth-public .form-control,
  .ez-auth-public .btn-primary {
    font-size: 16px;
    min-height: 48px;
  }

  .ez-auth-links {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .ez-auth-shell {
    align-items: flex-start;
    padding-bottom: 20px;
    padding-top: 56px;
  }

  .ez-auth-card {
    max-width: 560px;
    padding-bottom: 22px;
    padding-top: 22px;
  }

  .ez-auth-brand {
    margin-bottom: 12px;
  }

  .ez-auth-subtitle {
    margin-bottom: 16px;
  }
}
