/* Shared auth styles: split-screen hero + card (sign in, sign up, OTP) */
:root {
  --bg-page: #f4f6f9;
  --navy: #0027a6;
  --blue-mid: #0441cb;
  --blue-bright: #1aa5fd;
  --blue-deep: #156cd4;
  --dark: #030404;
  --text: #1d2433;
  --text-muted: #657084;
  --card: #ffffff;
  --shadow: 0 24px 60px rgba(3, 4, 4, 0.32);

  --brand: var(--navy);
  --brand-hover: #001a73;
  --brand-ring: rgba(0, 39, 166, 0.18);
  --line: #e3e8ef;
  --field-line: #d9dee7;
  --error-text: #b91c1c;

  /* Password strength colours (read by the sign-up script) */
  --danger-color: #ef4444;
  --orange-color: #f97316;
  --warning-color: #f59e0b;
  --info-color: #156cd4;
  --success-color: #0027a6;

  --fs-body: 14px;
  --fs-h1: 24px;
  --fs-copyright: 12px;
}

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

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout: vertical gradient on small screens, diagonal sweep once the hero shows */
.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 {
  position: sticky;
  top: 0;
  flex: 0 0 55%;
  min-width: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
}

/* Logo pinned to the top, tagline centred, both sharing one left edge */
.hero-inner {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  font-size: 5.41vw;
}

.hero-logo {
  align-self: start;
  justify-self: start;
  display: block;
  width: 190px;
  height: auto;
  margin: 40px 0 24px 0.0684em;
}

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

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

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

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

.auth-main {
  width: 100%;
  max-width: 440px;
}

/* Card */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.auth-logo {
  display: block;
  width: 262px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 24px;
}

.ac-head {
  margin-bottom: 22px;
  text-align: center;
}

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

.ac-head p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-wrap: balance;
}

.ac-head p b {
  color: var(--text);
  font-weight: 700;
  word-break: break-all;
}

/* Fields */
.field {
  margin-bottom: 16px;
}

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

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

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text);
}

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

.field-label-row .text-link {
  font-size: 14px;
  line-height: 20px;
}

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

.field-input::placeholder {
  color: #94a3b8;
}

.field-input:hover {
  border-color: #94a3b8;
}

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

.otp-input {
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.45em;
  padding-left: 0.45em;
}

.field-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.password-wrapper {
  position: relative;
}

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

.toggle-password {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}

.toggle-password:hover {
  color: var(--brand);
}

/* Remember me */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 20px;
}

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

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

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

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

/* Primary action */
.btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 7px;
  background: var(--brand);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(3, 4, 4, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease-in-out;
}

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

.field + .btn-primary {
  margin-top: 8px;
}

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

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

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

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

.alert {
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  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.16);
}

.alert-success {
  color: var(--brand);
  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;
  margin-top: 8px;
}

.strength-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  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;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Desktop: show the hero; tablet and phone keep only the card */
@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%);
  }
}

@media (max-width: 1023px) {
  .auth-hero {
    display: none;
  }
}

@media (max-width: 639px) {
  .field-row {
    flex-direction: column;
    gap: 0;
  }
}

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

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

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