/* Lancea sign-in page — brand palette */
:root {
  --navy:     #102547;
  --mid-blue: #2a54a5;
  --cyan:     #2fbbe0;
  --off-white: #faf8f5;
  --white:    #ffffff;

  --text-dark:  #0f172a;
  --text-mid:   #475569;
  --text-light: #94a3b8;
  --border:     #e2e8f0;
  --error-fg:   #dc2626;
  --error-bg:   #fef2f2;
  --error-bdr:  #fecaca;
  --success-fg: #16a34a;
  --success-bg: #f0fdf4;
  --success-bdr:#bbf7d0;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--white);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────
   Page layout: split panel
───────────────────────────────────────────────────── */

.page {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────
   Left (branded) panel
───────────────────────────────────────────────────── */

.left-panel {
  flex: 0 0 42%;
  /* Lancea brand core graphic (arrow-burst on navy) as the panel background;
     navy base color fills any area the image does not cover. */
  background-color: var(--navy);
  background-image: url('assets/lancea-core-graphic.png');
  /* Zoom in (>cover) so the arrow-burst fills the panel edges; bias the crop so
     the burst reads as centered in this tall/narrow panel. */
  background-size: auto 150%;
  background-position: 25% center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  padding: 3rem 4rem;
  position: relative;
  overflow: hidden;
}

.left-content {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.logomark {
  height: 48px;   /* width auto-scales for the horizontal lockup */
  width: auto;
  flex-shrink: 0;
}

.left-header {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.25;
  color: var(--off-white);
  margin-bottom: 1.25rem;
}

.left-subheader {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(250, 248, 245, 0.7);
  margin-bottom: 3rem;
}

.left-footer {
  /* Pinned to the bottom of the branded panel (matches panel padding). */
  position: absolute;
  bottom: 3rem;
  left: 4rem;
  right: 4rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(250, 248, 245, 0.42);
}

.footer-shield {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────
   Right (sign-in) panel
───────────────────────────────────────────────────── */

.right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.sign-in-card {
  width: 100%;
  max-width: 400px;
}

.signin-heading {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}

.signin-subheading {
  font-size: 0.9375rem;
  color: var(--text-mid);
  margin-bottom: 1.75rem;
}

/* ─────────────────────────────────────────────────────
   Social / SSO buttons
───────────────────────────────────────────────────── */

.btn-google,
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 0.75rem;
}

.btn-google:hover,
.btn-sso:hover {
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.btn-google:focus-visible,
.btn-sso:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 2px;
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────
   Divider
───────────────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-light);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

/* ─────────────────────────────────────────────────────
   Form fields
───────────────────────────────────────────────────── */

.field-group {
  margin-bottom: 1rem;
}

.field-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}

.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="text"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-group input:focus {
  border-color: var(--mid-blue);
  box-shadow: 0 0 0 3px rgba(42, 84, 165, 0.12);
}

/* Password field with toggle button */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.75rem;
}

.btn-show-password {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.btn-show-password:hover {
  color: var(--text-mid);
}

.btn-show-password.active {
  color: var(--mid-blue);
}

.btn-show-password:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────
   Keep-signed-in + forgot-password row
───────────────────────────────────────────────────── */

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.625rem;
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-mid);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--mid-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mid-blue);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.forgot-link:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────
   Error message
───────────────────────────────────────────────────── */

.error-message {
  font-size: 0.875rem;
  color: var(--error-fg);
  background: var(--error-bg);
  border: 1px solid var(--error-bdr);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  display: none;
}

.error-message a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────
   Primary sign-in button (gradient)
───────────────────────────────────────────────────── */

.btn-signin {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--cyan) 0%, var(--mid-blue) 50%, var(--navy) 100%);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.btn-signin:hover {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(42, 84, 165, 0.38);
}

.btn-signin:active {
  opacity: 1;
  box-shadow: none;
}

.btn-signin:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────────────
   Legal footer
───────────────────────────────────────────────────── */

.legal-footer {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 1.5rem;
  text-align: center;
  line-height: 1.55;
}

.legal-footer a {
  color: var(--mid-blue);
  text-decoration: none;
}

.legal-footer a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────
   Forgot-password modal overlay
───────────────────────────────────────────────────── */

.forgot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.forgot-overlay.hidden {
  display: none;
}

/* ─────────────────────────────────────────────────────
   "Signing you in…" overlay (shown during the redirect
   return + IAP handshake so the form doesn't flash)
───────────────────────────────────────────────────── */

.signing-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: var(--white);
}

.signing-overlay.hidden {
  display: none;
}

.signing-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--mid-blue);
  border-radius: 50%;
  animation: signing-spin 0.8s linear infinite;
}

@keyframes signing-spin {
  to {
    transform: rotate(360deg);
  }
}

.signing-text {
  color: var(--text-mid);
  font-size: 0.95rem;
}

.forgot-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.forgot-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.forgot-card > p {
  font-size: 0.9375rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.forgot-message {
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  min-height: 0;
}

.forgot-message:empty {
  display: none;
}

.forgot-message.error {
  color: var(--error-fg);
  background: var(--error-bg);
  border: 1px solid var(--error-bdr);
}

.forgot-message.success {
  color: var(--success-fg);
  background: var(--success-bg);
  border: 1px solid var(--success-bdr);
}

.forgot-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-secondary {
  padding: 0.5625rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-mid);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 2px;
}

.btn-primary {
  padding: 0.5625rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--cyan) 0%, var(--mid-blue) 50%, var(--navy) 100%);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--mid-blue);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .page {
    flex-direction: column;
  }

  .left-panel {
    flex: none;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }

  .left-content {
    max-width: 100%;
  }

  .left-header {
    font-size: 1.5rem;
  }

  .left-subheader {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .logo-wrap {
    margin-bottom: 2rem;
  }

  .right-panel {
    align-items: flex-start;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .sign-in-card {
    max-width: 100%;
  }

  .left-subheader {
    display: none;
  }

  .left-footer {
    display: none;
  }
}
