@charset "UTF-8";
/* Alexandria Auth — High-End Editorial Style */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@400;700&family=Inter:wght@400;500;600&family=Public+Sans:wght@400;500;600&display=swap');

:root {
  --primary: #094cb2;
  --primary-container: #d4e3ff;
  --on-primary: #ffffff;
  --surface: #fafafa;
  --surface-dim: #f0f1f4;
  --surface-container: #ecedf0;
  --surface-container-low: #f4f5f8;
  --surface-container-lowest: #ffffff;
  --on-surface: #1a1c20;
  --on-surface-variant: #44474e;
  --outline-variant: #c4c6cf;
  --tertiary: #6d5e00;
  --error: #ba1a1a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: var(--on-surface);
  background: var(--surface-dim);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page wrapper */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--surface-container-lowest) 0%, var(--surface-dim) 100%);
}

/* Card container */
.auth-card {
  width: 100%;
  max-width: 400px;
  margin-top: 16px;
  padding: 28px 24px 20px;
  background: var(--surface-container-lowest);
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(26, 28, 32, 0.06);
  position: relative;
}

/* Brand header */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--on-primary);
}

.auth-brand-name {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--on-surface);
  letter-spacing: 0.02em;
}

/* Headline */
.auth-headline {
  font-family: 'Noto Serif', serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: var(--on-surface);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Form group */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.auth-label-text {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--on-surface);
}

.auth-label-link {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.auth-label-link:hover {
  text-decoration: underline;
}

/* Input fields */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--on-surface-variant);
  pointer-events: none;
}

.auth-input-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--on-surface);
  background: var(--surface-dim);
  border: 2px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-input:focus {
  border-color: var(--primary);
  background: var(--surface-container-lowest);
}

.auth-input::placeholder {
  color: var(--outline-variant);
  font-size: 13px;
}

/* Password toggle */
.auth-pwd-toggle {
  position: absolute;
  right: 14px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  color: var(--on-surface-variant);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-pwd-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Verification code input row */
.auth-code-row {
  display: flex;
  gap: 10px;
}

.auth-code-row .auth-input-wrap {
  flex: 1;
}

.auth-code-btn {
  flex-shrink: 0;
  height: 48px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: var(--surface-dim);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.auth-code-btn:hover {
  background: var(--surface-container);
}

.auth-code-btn.on {
  color: var(--on-surface-variant);
  cursor: default;
}

/* Checkbox */
.auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-checkbox-label {
  font-size: 13px;
  color: var(--on-surface-variant);
}

/* Primary button — gradient CTA */
.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary) 0%, #3a7ae8 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  margin-bottom: 14px;
}

.auth-btn-primary:hover {
  opacity: 0.92;
}

.auth-btn-primary:active {
  transform: scale(0.985);
}

.auth-btn-primary svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Links row */
.auth-link-row {
  text-align: center;
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 8px;
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Footer */
.auth-footer {
  margin-top: auto;
  padding: 16px 0 14px;
  text-align: center;
}

.auth-footer-text {
  font-family: 'Public Sans', sans-serif;
  font-size: 11px;
  color: var(--outline-variant);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-footer-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Public Sans', sans-serif;
  font-size: 11px;
  color: var(--outline-variant);
  letter-spacing: 0.04em;
}

.auth-footer-security svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

/* Steps indicator (register) */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 14px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  width: 70px;
}

.auth-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Public Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.auth-step.active .auth-step-num {
  background: var(--primary);
  color: var(--on-primary);
}

.auth-step.inactive .auth-step-num {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

.auth-step-label {
  font-family: 'Public Sans', sans-serif;
  font-size: 11px;
  color: var(--on-surface-variant);
}

.auth-step.active .auth-step-label {
  color: var(--primary);
  font-weight: 500;
}

.auth-step-line {
  width: 40px;
  height: 2px;
  background: var(--surface-container);
  margin-bottom: 18px;
}

/* Register icon */
.auth-reg-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-container);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.auth-reg-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.8;
}

/* Register headline centered */
.auth-headline-center {
  font-family: 'Noto Serif', serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3;
  color: var(--on-surface);
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle-center {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 18px;
}

/* Agreement text */
.auth-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

.auth-agreement a {
  color: var(--primary);
  text-decoration: none;
}

.auth-agreement a:hover {
  text-decoration: underline;
}

/* Toast notification */
.auth-toast-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 0;
  pointer-events: none;
}

.auth-toast {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-container-lowest);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26, 28, 32, 0.12), 0 2px 8px rgba(26, 28, 32, 0.06);
  pointer-events: auto;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  position: relative;
  overflow: hidden;
}

.auth-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.auth-toast.hide {
  transform: translateY(-120%);
  opacity: 0;
}

/* Left accent bar */
.auth-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

.auth-toast.toast-error::before { background: var(--error); }
.auth-toast.toast-success::before { background: #16a34a; }
.auth-toast.toast-info::before { background: var(--primary); }

/* Icon circle */
.auth-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-toast-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.toast-error .auth-toast-icon {
  background: rgba(186, 26, 26, 0.08);
}
.toast-error .auth-toast-icon svg { stroke: var(--error); }

.toast-success .auth-toast-icon {
  background: rgba(22, 163, 74, 0.08);
}
.toast-success .auth-toast-icon svg { stroke: #16a34a; }

.toast-info .auth-toast-icon {
  background: rgba(9, 76, 178, 0.08);
}
.toast-info .auth-toast-icon svg { stroke: var(--primary); }

/* Text area */
.auth-toast-body {
  flex: 1;
  min-width: 0;
}

.auth-toast-title {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.toast-error .auth-toast-title { color: var(--error); }
.toast-success .auth-toast-title { color: #16a34a; }
.toast-info .auth-toast-title { color: var(--primary); }

.auth-toast-msg {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-surface-variant);
  word-break: break-word;
}

/* Close button */
.auth-toast-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  color: var(--outline-variant);
  transition: background 0.15s, color 0.15s;
  margin-top: -2px;
}

.auth-toast-close:hover {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

.auth-toast-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Progress bar (auto dismiss) */
.auth-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  transition: width linear;
}

.toast-error .auth-toast-progress { background: rgba(186, 26, 26, 0.2); }
.toast-success .auth-toast-progress { background: rgba(22, 163, 74, 0.2); }
.toast-info .auth-toast-progress { background: rgba(9, 76, 178, 0.2); }

/* Legacy msgbox overlay — kept for redirect confirmations */
.auth-msgbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 28, 32, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.auth-msgbox-overlay.show { display: flex; }

.auth-msgbox {
  width: 85%;
  max-width: 320px;
  background: var(--surface-container-lowest);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(26, 28, 32, 0.1);
  animation: msgboxIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgboxIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-msgbox-title {
  padding: 16px 20px;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary) 0%, #3a7ae8 100%);
}

.auth-msgbox-content {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface);
}

.auth-msgbox-actions {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-msgbox-btn {
  padding: 8px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-msgbox-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.auth-msgbox-btn-primary:hover { opacity: 0.9; }

/* Phone prefix */
.auth-phone-prefix {
  position: absolute;
  left: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.auth-input.has-prefix {
  padding-left: 70px;
}

/* Error tips */
.auth-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

/* Responsive */
@media (max-width: 375px) {
  .auth-card {
    padding: 24px 18px 20px;
    margin-top: 12px;
  }
  .auth-headline, .auth-headline-center {
    font-size: 22px;
  }
}
