@import url("/css/components.css");

:root {
  --auth-bg: #f4f6fb;
  --auth-bg-soft: #ffffff;
  --auth-panel-bg: #ffffff;
  --auth-border: #dbe3f0;
  --auth-border-strong: #c3cee2;
  --auth-text: #0f172a;
  --auth-text-strong: #0b1324;
  --auth-muted: #667085;
  --auth-accent: #5565f5;
  --auth-accent-hover: #4656ea;

  --auth-success: #1f9f70;
  --auth-success-bg: rgba(31, 159, 112, 0.12);
  --auth-error: #cc345b;
  --auth-error-bg: rgba(204, 52, 91, 0.12);
  --auth-warning: #b57a0f;
  --auth-warning-bg: rgba(181, 122, 15, 0.12);

  --auth-input-bg: #ffffff;
  --auth-input-placeholder: #8d97ab;
  --auth-focus-ring: rgba(85, 101, 245, 0.2);

  --auth-tab-active-bg: rgba(85, 101, 245, 0.12);
  --auth-tab-active-text: #2f3ec6;
  --auth-link: #4b57de;

  --auth-step: #7c879d;
  --auth-step-active: #0f172a;
  --auth-step-done: #1f9f70;

  --auth-toggle-bg: #f4f7fd;
  --auth-toggle-bg-hover: #eaf0fb;
  --auth-toggle-text: #2d3f62;

  --auth-oauth-text: #1e293b;
  --auth-oauth-bg: transparent;
  --auth-oauth-border: #d4ddeb;
  --auth-oauth-border-hover: #b9c6df;

  --auth-apple-bg: #111827;
  --auth-apple-text: #f7f9ff;
  --auth-apple-border: #111827;
  --auth-apple-hover-bg: #000000;

  --auth-visual-background:
    radial-gradient(1200px 560px at 20% 30%, rgba(85, 101, 245, 0.2), transparent 58%),
    radial-gradient(900px 420px at 75% 78%, rgba(122, 99, 246, 0.16), transparent 62%),
    #edf2fc;
  --auth-visual-text: #0f172a;
  --auth-visual-muted: #536078;
}


* {
  box-sizing: border-box;
}

body.auth-plain-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans, "Inter", "Segoe UI", Arial, sans-serif);
  color: var(--auth-text);
  background: var(--auth-bg);
}

.hidden {
  display: none !important;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
}

.auth-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  border-right: 1px solid var(--auth-border);
  background: var(--auth-visual-background);
}

.auth-visual-inner {
  max-width: 520px;
}

.auth-visual-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: block;
  margin-bottom: 26px;
}

.auth-visual-wordmark {
  width: 170px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.auth-visual h1 {
  margin: 0;
  font-size: clamp(2rem, 4.1vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--auth-visual-text);
}

.auth-visual p {
  margin: 14px 0 0;
  color: var(--auth-visual-muted);
  font-size: 1.04rem;
  line-height: 1.55;
  max-width: 34ch;
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: var(--auth-bg-soft);
  gap: 12px;
}

.auth-panel {
  width: min(430px, 100%);
  background: transparent;
  border: none;
  padding: 8px 0;
  box-shadow: none;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-logo-small {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.auth-header h2 {
  margin: 0;
  font-size: 1.26rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--auth-text-strong);
}

.theme-toggle {
  margin-left: auto;
  height: 34px;
  width: 34px;
  padding: 0;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: var(--auth-toggle-bg);
  color: var(--auth-toggle-text);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--auth-toggle-bg-hover);
  border-color: var(--auth-border-strong);
}

.theme-toggle i {
  pointer-events: none;
}

.tabs {
  display: none !important;
}

.tab {
  height: 42px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.tab:hover {
  color: var(--auth-text);
  border-color: var(--auth-border-strong);
}

.tab.active {
  border-color: var(--auth-accent);
  background: var(--auth-tab-active-bg);
  color: var(--auth-tab-active-text);
}

.alert {
  display: none;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--auth-border);
  font-size: 0.85rem;
  font-weight: 600;
}

.alert.show {
  display: block;
}

.alert-success {
  border-color: color-mix(in srgb, var(--auth-success) 50%, var(--auth-border) 50%);
  background: var(--auth-success-bg);
  color: var(--auth-success);
}

.alert-error {
  border-color: color-mix(in srgb, var(--auth-error) 50%, var(--auth-border) 50%);
  background: var(--auth-error-bg);
  color: var(--auth-error);
}

.alert-warning {
  border-color: color-mix(in srgb, var(--auth-warning) 50%, var(--auth-border) 50%);
  background: var(--auth-warning-bg);
  color: var(--auth-warning);
}

.login-stepper {
  display: flex;
  gap: 16px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--auth-border);
}

.login-step {
  font-size: 0.8rem;
  color: var(--auth-step);
}

.login-step.active {
  color: var(--auth-step-active);
  font-weight: 700;
}

.login-step.done {
  color: var(--auth-step-done);
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--auth-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 44px;
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  padding: 0 12px;
  font-size: 0.95rem;
  color: var(--auth-text);
  background: var(--auth-input-bg);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--auth-input-placeholder);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 2px var(--auth-focus-ring);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--auth-toggle-bg);
  color: var(--auth-text);
}

.login-email-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-size: 0.84rem;
}

#btn-change-email {
  border: 0;
  background: transparent;
  color: var(--auth-link);
  font-weight: 600;
  cursor: pointer;
}

.legacy-explainer,
.legacy-reset-info {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--auth-muted);
  line-height: 1.4;
}

.btn {
  width: 100%;
  height: 44px;
  border-radius: 22px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.btn-primary {
  margin-top: 4px;
  background: var(--auth-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--auth-accent-hover);
}

.btn-secondary {
  margin-top: 8px;
  background: transparent;
  border-color: var(--auth-border);
  color: var(--auth-text);
}

.btn-secondary:hover {
  border-color: var(--auth-border-strong);
}

.magic-link-note,
.password-hint,
.forgot-password-link,
.signup-login-link,
.otp-expiry,
.otp-resend,
.otp-back {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--auth-muted);
}

.otp-resend a,
.otp-back a,
.signup-login-link a,
.forgot-password-link a {
  color: var(--auth-link);
  text-decoration: none;
}

.otp-resend a:hover,
.otp-back a:hover,
.signup-login-link a:hover,
.forgot-password-link a:hover {
  text-decoration: underline;
}

.otp-header {
  margin-bottom: 10px;
}

.otp-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--auth-text-strong);
}

.otp-header p {
  margin: 4px 0 0;
  color: var(--auth-muted);
  font-size: 0.84rem;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.otp-digit {
  height: 44px;
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  background: var(--auth-input-bg);
  color: var(--auth-text-strong);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--auth-accent);
}

.otp-digit.filled {
  border-color: var(--auth-accent);
}

.auth-divider {
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.oauth-buttons {
  display: grid;
  gap: 8px;
}

.btn-oauth {
  border-color: var(--auth-oauth-border);
  background: var(--auth-oauth-bg);
  color: var(--auth-oauth-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-oauth:hover {
  border-color: var(--auth-oauth-border-hover);
}

.oauth-icon {
  width: 16px;
  height: 16px;
}

.btn-apple {
  background: var(--auth-apple-bg);
  color: var(--auth-apple-text);
  border-color: var(--auth-apple-border);
}

.btn-apple:hover {
  background: var(--auth-apple-hover-bg);
}

.auth-links {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-links a {
  color: var(--auth-muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--auth-text);
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    display: none;
  }

  .auth-main {
    padding: 20px 14px;
  }
}

@media (max-width: 520px) {
  .auth-main {
    padding: 14px 10px;
  }

  .auth-header h2 {
    font-size: 1.1rem;
  }

  .theme-toggle {
    height: 32px;
    width: 32px;
    font-size: 0.85rem;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    height: 40px;
  }

  .otp-inputs {
    gap: 6px;
  }

  .otp-digit {
    height: 40px;
    border-radius: 12px;
  }
}

/* Bottom switch card style (Instagram-like, flat borderless variant) */
.auth-switch-card {
  width: min(430px, 100%);
  background: transparent;
  border: none;
  padding: 10px 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  box-sizing: border-box;
  margin-top: 8px;
}

.auth-switch-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

.auth-switch-card a {
  color: var(--auth-link);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.auth-switch-card a:hover {
  text-decoration: underline;
}


