/* Auth — white space, marigold accent, black type */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f7f7f5;
  overflow-x: hidden;
}

:root {
  --auth-primary: #f2bc09;
  --auth-primary-dark: #d9a908;
  --auth-accent-ring: rgba(242, 188, 9, 0.35);
  --auth-bg: #f7f7f5;
  --auth-card-bg: #ffffff;
  --auth-text: #0a0a0a;
  --auth-text-muted: #5c5c58;
  --auth-border: #e8e8e4;
  --auth-radius: 16px;
  --auth-radius-sm: 12px;
  --auth-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --auth-shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.12);
  --auth-input-height: 48px;
  --auth-touch-min: 48px;
}

.auth-modern {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: linear-gradient(165deg, #ffffff 0%, #f7f7f5 45%, rgba(242, 188, 9, 0.08) 100%);
  font-family: Perpetua, "Perpetua Titling MT", Georgia, "Times New Roman", serif !important;
}

.auth-modern__card {
  width: 100%;
  max-width: 420px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow-lg);
  padding: 2rem 1.5rem;
  animation: authSlideUp 0.4s ease-out;
  border-top: 4px solid var(--auth-primary);
}

.auth-modern__card form {
  width: 100%;
}

@keyframes authSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modern__logo-wrap {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-modern__logo-wrap.no-logo .auth-modern__logo {
  display: none;
}

.auth-modern__logo-wrap.no-logo .auth-modern__logo-text {
  display: block;
}

.auth-modern__logo {
  display: block;
  margin: 0 auto;
  max-width: 180px;
  height: auto;
}

.auth-modern__logo-text {
  display: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-text);
  font-family: Perpetua, "Perpetua Titling MT", Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.auth-modern__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-text);
  margin-bottom: 0.25rem;
  text-align: center;
  font-family: Perpetua, "Perpetua Titling MT", Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.auth-modern__subtitle {
  font-size: 0.9375rem;
  color: var(--auth-text-muted);
  margin-bottom: 0.75rem;
  text-align: center;
}

.auth-modern__hint {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  margin: 0 0 1.5rem;
  text-align: center;
  line-height: 1.45;
}

.auth-modern__hint strong {
  color: var(--auth-text);
  font-weight: 600;
}

.auth-modern__form {
  margin-top: 0.25rem;
}

.auth-modern__footnote {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--auth-text-muted);
}

.auth-modern .form-group {
  margin-bottom: 1.25rem;
  width: 100%;
}

.auth-modern .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 0.5rem;
}

.auth-modern .form-control {
  width: 100%;
  height: var(--auth-input-height);
  min-height: var(--auth-touch-min);
  padding: 0 1rem;
  font-size: 1rem;
  border: 2px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-modern .form-control:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px var(--auth-accent-ring);
}

.auth-modern .form-control.is-invalid {
  border-color: #dc2626;
}

.auth-modern .input-wrapper.has-error {
  border-color: #dc2626;
}

.auth-modern .input-wrapper.has-error:focus-within {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.auth-modern .form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.auth-modern .form-control::placeholder {
  color: #94a3b8;
}

.auth-modern .input-wrapper {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--auth-input-height);
  min-height: var(--auth-touch-min);
  border: 2px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-modern .input-wrapper:focus-within {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px var(--auth-accent-ring);
}

.auth-modern .input-wrapper .form-control {
  flex: 1;
  min-width: 0;
  border: none;
  padding-right: 0.75rem;
  background: transparent;
}

.auth-modern .input-wrapper .form-control:focus {
  border: none;
  box-shadow: none;
}

.auth-modern .input-wrapper .form-control.is-invalid {
  border: none;
}

.auth-modern .password-toggle {
  flex-shrink: 0;
  width: 52px;
  border: none;
  border-left: 1px solid var(--auth-border);
  padding: 0;
  cursor: pointer;
  color: var(--auth-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, background 0.2s;
}

.auth-modern .password-toggle:hover {
  color: var(--auth-text);
  background: rgba(242, 188, 9, 0.15);
}

.auth-modern .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-modern .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--auth-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-modern .form-check-label {
  font-size: 0.9375rem;
  color: var(--auth-text);
  cursor: pointer;
}

.auth-modern .btn-primary {
  width: 100%;
  height: var(--auth-input-height);
  min-height: var(--auth-touch-min);
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-primary);
  color: var(--auth-text);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.auth-modern .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(242, 188, 9, 0.55);
  background: var(--auth-primary-dark);
}

.auth-modern .btn-primary:active {
  transform: translateY(0);
}

.auth-modern .alert {
  padding: 1rem;
  border-radius: var(--auth-radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.auth-modern .alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-modern .alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-modern .invalid-feedback {
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

@media (min-width: 640px) {
  .auth-modern__card {
    padding: 2.5rem 2rem;
  }
  
  .auth-modern__title {
    font-size: 1.75rem;
  }
}
