/* Shared styles for every sign-in, sign-up, password and OTP page (templates extend auth_base.html) */
:root {
  --bg-page: #f4f6f9;
  --navy: #0027a6;
  --navy-hover: #021c80;
  --blue-mid: #0441cb;
  --blue-bright: #1aa5fd;
  --blue-deep: #156cd4;
  --dark: #030404;
  --text: #1d2433;
  --text-muted: #657084;
  --text-placeholder: #8a93a6;
  --card: #ffffff;
  --field-line: #d9dee7;
  --focus-ring: rgba(4, 65, 203, 0.16);
  --shadow: 0 24px 60px rgba(3, 4, 4, 0.32);
  --error-text: #b91c1c;
  --danger-color: #ef4444;
  --orange-color: #f97316;
  --warning-color: #f59e0b;
  --info-color: #156cd4;
  --success-color: #0027a6;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout: gradient canvas, brand hero (desktop) and auth column ---------- */
.auth-split {
  display: flex;
  min-height: 100vh;
  background-color: var(--navy);
  background-image: linear-gradient(180deg, #eaf5ff 0%, #1aa5fd 30%, #156cd4 52%, #0027a6 76%, #030404 100%);
}

.auth-hero {
  display: none;
}

.auth-scroll {
  flex: 1;
  min-width: 0;
}

.auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px 20px;
}

@media (min-width: 1024px) {
  .auth-split {
    background-image: linear-gradient(60deg, #ffffff 0%, #eef7ff 30%, #cfeafe 46%, #1aa5fd 66%, #156cd4 78%, #0027a6 90%, #030404 100%);
  }

  .auth-hero {
    display: flex;
    justify-content: center;
    flex: 0 0 55%;
    min-width: 0;
  }

  .auth-hero-art {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    font-size: 5.41vw;
  }

  .auth-hero-logo {
    place-self: start;
    width: 190px;
    height: auto;
    margin: 40px 0 24px 0.0684em;
  }

  .auth-hero-tagline {
    color: var(--dark);
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
  }

  .auth-hero-tagline span {
    display: block;
  }

  .auth-hero-tagline .tl-quick {
    width: fit-content;
    color: var(--blue-mid);
    font-weight: 700;
    background: linear-gradient(90deg, #021798, #066dfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* ---------- Card ---------- */
.auth-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 440px;
  padding: 32px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-card--wide {
  max-width: 500px;
}

.auth-brand {
  display: flex;
  justify-content: center;
}

.auth-brand img {
  display: block;
  width: 262px;
  max-width: 100%;
  height: auto;
}

.ac-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.ac-head h1 {
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.ac-head p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: balance;
}

.auth-copyright {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

/* ---------- Form ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: flex;
  gap: 16px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.field-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.field-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field-line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.field-input::placeholder {
  color: var(--text-placeholder);
}

.field-input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* One-time code: large, spaced digits */
.field-input--otp {
  height: 52px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-align: center;
}

.field-input--otp::placeholder {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.field-hint {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 18px;
}

.password-wrapper {
  position: relative;
}

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

.toggle-password {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #4a5366;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.toggle-password:hover {
  color: var(--navy);
  background: #f1f4f9;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  cursor: pointer;
}

.text-link {
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  transition: color 0.2s ease-in-out;
}

.text-link:hover {
  color: var(--blue-mid);
  text-decoration: underline;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 7px;
  background: var(--navy);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

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

.btn-primary:focus-visible,
.text-link:focus-visible,
.toggle-password:focus-visible,
.checkbox input:focus-visible {
  outline: 2px solid var(--blue-mid);
  outline-offset: 2px;
}

/* Footer line inside the card: switch between sign in / sign up, or back to sign in */
.auth-switch {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Errors and alerts ---------- */
.field-error {
  color: var(--error-text);
  font-size: 13px;
  font-weight: 500;
}

.field-error:empty {
  display: none;
}

.alert {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.alert-danger,
.alert-error {
  color: var(--error-text);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.alert-success {
  color: var(--navy);
  background: rgba(0, 39, 166, 0.06);
  border-color: rgba(0, 39, 166, 0.16);
}

.alert-info {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.16);
}

.alert-warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

/* ---------- Password strength ---------- */
.password-strength-indicator {
  display: none;
}

.strength-track {
  height: 6px;
  border-radius: 999px;
  background: #e6eaf0;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.strength-text {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

/* ---------- Small screens ---------- */
@media (max-width: 639px) {
  .field-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .auth-layout {
    justify-content: flex-start;
    padding: 20px 12px;
  }

  .auth-card {
    margin: auto 0;
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
