/* SIGN IN PAGE - shared tokens from base.css, not its own palette. */
/* Always light: theme.js is not loaded here, so body.dark never gets set. */

/* The global reset lives in base.css, which every page loads first. */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: var(--body-color);
  /* Not overflow:hidden - an error message must never be trapped off-screen on a short laptop. */
  overflow-y: auto;
}

/* The background arch (.round-container) comes from base.css, exactly as on every other page. */

/* CARD */
.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 940px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(16, 24, 40, .2),
              0 3px 10px rgba(16, 24, 40, .06);
  animation: cardRise .5s cubic-bezier(.22, 1, .36, 1);
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(22px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* BRAND PANEL */
.login-brand {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 46px 38px;
  color: #fff5ea;
  background: linear-gradient(155deg, #c47f3e 0%, #a3652c 55%, #7d4a1d 100%);
}

/* A faint texture so the panel is not a flat slab of brown */
.login-brand {
  background-image:
    radial-gradient(circle at 80% 8%, rgba(255, 255, 255, .14) 0%, transparent 42%),
    linear-gradient(155deg, #c47f3e 0%, #a3652c 55%, #7d4a1d 100%);
}

.brand-logo {
  height: 66px;
  width: auto;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .28));
}

.login-brand h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.brand-tagline {
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, .82);
}

/* ---------- Feature points ---------- */
.brand-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: auto;
}

.brand-points li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.brand-points i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  font-size: 19px;
  color: #fff;
}

.brand-points span {
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .78);
}

.brand-points strong {
  display: block;
  margin-bottom: 1px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.brand-address {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .7);
}

.brand-address i { font-size: 15px; flex-shrink: 0; }

/* FORM PANEL */
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px 42px;
  background: var(--surface);
}

.login-heading { margin-bottom: 26px; }

.login-heading h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.login-heading p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* FIELDS */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}

/* Wrapper so the icon and the peek button can sit inside the field */
.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  font-size: 19px;
  line-height: 1;
  color: var(--ink-3);
  pointer-events: none;
  transition: color .2s ease;
}

.input-shell:focus-within .field-icon { color: var(--brand); }

.form-control {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-control::placeholder { color: var(--ink-3); }

.form-control:hover { border-color: var(--brand); }

.form-control:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Password field leaves room for the peek button */
#password { padding-right: 46px; }

/* THE VERIFICATION CODE FIELD - The second sign-in step. */
.otp-field {
  /* The icon needs 44px on the left, so the right matches it - without. */
  padding-right: 44px;
  text-align: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;

  /* Tracking is added after the last character too, so the indent puts the row back in the middle. */
  letter-spacing: .2em;
  text-indent: .2em;
}

.otp-field::placeholder {
  font-weight: 500;
  opacity: .45;
  letter-spacing: .2em;
}

/* The way out when the phone is gone. */
.login-hint {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.peek-btn {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 19px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.peek-btn:hover { background: var(--brand-soft); color: var(--brand-deep); }

.peek-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field-error {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #dc2626;
}

/* ALERTS */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-3);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  animation: cardRise .3s ease-out;
}

.alert-box i { font-size: 19px; flex-shrink: 0; margin-top: 1px; }

.alert-error   { border-left-color: #dc2626; }
.alert-error i { color: #dc2626; }

.alert-success   { border-left-color: #16a34a; }
.alert-success i { color: #16a34a; }

.alert-info   { border-left-color: #2563eb; }
.alert-info i { color: #2563eb; }

/* The token from base.css rather than a repeated literal - its siblings above predate. */
.alert-warning   { border-left-color: var(--alert-warning); }
.alert-warning i { color: var(--alert-warning); }

/* SUBMIT */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196, 127, 62, .32);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.btn-login i { font-size: 20px; }

.btn-login:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 8px 24px rgba(196, 127, 62, .4);
}

.btn-login:active { transform: translateY(0); }

/* HELP LINE */
.login-help {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.login-help i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.login-help a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: none;
}

.login-help a:hover { text-decoration: underline; }

.login-help a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* VISITOR FAQ - a compact trigger keeps help outside the sign-in flow. */
.login-faq-access { margin-top: 18px; text-align: center; }
.login-faq-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary-color-light);
  font: 600 12.5px/1.5 'Poppins', sans-serif;
  cursor: pointer;
}
.login-faq-trigger i { font-size: 18px; }
.login-faq-trigger:hover { background: var(--brand-soft); border-color: var(--brand); }
.login-page.login-faq-open { overflow: hidden; }

.login-faq {
  width: calc(100% - 32px);
  max-width: 640px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  min-width: 0;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(16, 24, 40, .24);
  overflow: hidden;
}
.login-faq[open] { display: flex; flex-direction: column; }
.login-faq::backdrop { background: rgba(27, 32, 40, .55); backdrop-filter: blur(3px); }

.login-faq-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.login-faq-heading > div { min-width: 0; }
.login-faq-heading h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.login-faq-heading p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}
.login-faq-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 24px;
  cursor: pointer;
}
.login-faq-close:hover { background: var(--brand-soft); color: var(--primary-color-light); }

.login-faq-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.login-faq-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}
.login-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 15px 16px;
  border-radius: 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  list-style: none;
  cursor: pointer;
}
.login-faq-item summary::-webkit-details-marker { display: none; }
.login-faq-item summary:hover { background: var(--brand-soft); }
.login-faq-item summary:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: -3px;
}
.login-faq-item summary i {
  flex-shrink: 0;
  color: var(--brand-deep);
  font-size: 20px;
  transition: transform .18s ease;
}
.login-faq-item[open] summary i { transform: rotate(180deg); }
.login-faq-item > p {
  padding: 0 16px 16px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
}
.login-faq-item a {
  color: var(--primary-color-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .login-faq-item summary i { transition: none; }
}
/* RESPONSIVE */
@media (max-width: 860px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }

  /* The brand panel becomes a compact header. */
  .login-brand {
    padding: 30px 28px;
    gap: 0;
    text-align: center;
    align-items: center;
  }

  .brand-points,
  .brand-address { display: none; }

  .brand-logo { height: 54px; margin-bottom: 12px; }
  .login-brand h1 { font-size: 22px; }

  .login-panel { padding: 32px 28px 36px; }
  .login-heading { margin-bottom: 22px; }
  .login-heading h2 { font-size: 21px; }
}

@media (max-width: 420px) {
  .login-page { padding: 14px 12px; }
  .login-card { border-radius: 18px; }
  .login-brand { padding: 26px 20px; }
  .login-panel { padding: 26px 20px 30px; }
  .login-faq { border-radius: 16px; }
  .login-faq-heading { gap: 10px; padding: 18px; }
  .login-faq-list { padding: 16px 18px 18px; }
  .login-faq-heading h2 { font-size: 18px; }

  /* 16px stops iOS from zooming the page on focus. */
  .form-control { font-size: 16px; }
}

/* Very short windows: let the page scroll rather than clip the card. */
@media (max-height: 620px) {
  .login-page { align-items: flex-start; }
}

/* Keep help and its close control usable in short, highly zoomed windows. */
@media (max-height: 420px) {
  .login-faq { overflow-y: auto; }
  .login-faq-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
  }
  .login-faq-heading h2 { font-size: 16px; }
  .login-faq-heading p { display: none; }
  .login-faq-list { flex-shrink: 0; overflow: visible; padding: 12px 16px 16px; }
}

/* The address typed into the reset form, shown back so a typo is
   visible. Not a statement that the account exists - see
   password_sent.html. */
.typed-address {
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

/* What to do when nothing arrives, instead of one run-on sentence. */
.sent-steps {
  margin: 7px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}

.sent-steps li { line-height: 1.5; }
