/* login-kit: standardized login styles.
   Generated from login-config.md — edit the config and re-run, not this file.
   Layout values are the proven standard (card 400px, 44px inputs, 0.85rem
   rhythm, 8px button/input corners); only colors, fonts, logo, and label
   come from the per-app config. */

:root {
  --lk-page-bg:      #062840;
  --lk-card-bg:      #ffffff;
  --lk-text:         #062840;
  --lk-text-muted:   #456f83;
  --lk-label:        #062840;
  --lk-input-bg:     #ffffff;
  --lk-input-border: #e5e7eb;
  --lk-cta-bg:       #c9a96e;
  --lk-cta-text:     #ffffff;
  --lk-accent:       #1a9fc4;
  --lk-error:        #dc2626;
  --lk-success:      #16a34a;
  --lk-font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* The native [hidden] attribute loses to any element-level display rule,
   so enforce it globally — views/panels toggle via the hidden attribute. */
[hidden] { display: none !important; }

.lk-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background: var(--lk-page-bg);
  font-family: var(--lk-font-body);
}

.lk-card {
  background: var(--lk-card-bg);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lk-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
}
.lk-logo { height: 80px; max-width: 220px; width: auto; object-fit: contain; }
@media (min-width: 600px) { .lk-logo { height: 100px; max-width: 260px; } }
.lk-brand-sub {
  font-size: var(--fs-sm, 14px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--lk-text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.lk-card label {
  font-size: var(--fs-sm, 14px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--lk-label);
  margin: 0 0 -2px;
}

.lk-card input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  /* max(): iOS Safari zooms the page when a focused input computes under 16px,
     so this floor is part of the behaviour, not a style preference. Keeping it as
     max() means a future change to --fs-md cannot silently reintroduce the zoom. */
  font-size: max(16px, var(--fs-md, 1.0625rem));
  border: 1px solid var(--lk-input-border);
  border-radius: 8px;
  background: var(--lk-input-bg);
  color: var(--lk-text);
  transition: border-color .15s;
}
.lk-card input:focus { outline: none; border-color: var(--lk-accent); }

.lk-pw-wrap { position: relative; display: flex; align-items: center; }
.lk-pw-wrap input { padding-right: 2.75rem; }
.lk-pw-eye {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--lk-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lk-pw-eye:focus-visible { outline: 2px solid var(--lk-accent); border-radius: 4px; }
.lk-eye-icon { display: block; }

.lk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  background: var(--lk-cta-bg);
  color: var(--lk-cta-text);
  border: none;
  border-radius: 8px;
  font-family: var(--lk-font-body);
  /* max(): iOS Safari zooms the page when a focused input computes under 16px,
     so this floor is part of the behaviour, not a style preference. Keeping it as
     max() means a future change to --fs-md cannot silently reintroduce the zoom. */
  font-size: max(16px, var(--fs-md, 1.0625rem));
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.lk-btn:hover { opacity: .92; }
.lk-btn:active { transform: scale(0.97); }
.lk-btn:disabled { opacity: .5; cursor: not-allowed; }

.lk-error { font-size: var(--fs-sm, .875rem); color: var(--lk-error); min-height: 1.2em; margin: 0.85rem 0 0; text-align: center; }

.lk-forgot-wrap { text-align: center; margin-top: 0.85rem; line-height: 1.2; }
.lk-link {
  background: none;
  border: none;
  color: var(--lk-accent);
  font-family: var(--lk-font-body);
  font-size: var(--fs-sm, .875rem);
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  line-height: 1.2;
  text-decoration: underline;
}
.lk-link:hover { opacity: .85; }

.lk-forgot-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lk-input-border);
}
.lk-forgot-panel label { margin: 0; }
.lk-forgot-msg { font-size: var(--fs-sm, .875rem); color: var(--lk-success); text-align: center; margin: 0.25rem 0 0; }

.lk-config-warning {
  font-size: var(--fs-xs, .8125rem);
  color: var(--lk-error);
  text-align: center;
  margin: 0.5rem 0 0;
}

.lk-reset-success-msg { font-size: var(--fs-base, .9375rem); color: var(--lk-text); margin: 1.5rem 0; line-height: 1.5; }

/* ── Phone / one-time-code sign-in ─────────────────────────────────── */
.lk-code-sent {
  font-size: var(--fs-sm, .875rem);
  color: #456f83;
  text-align: center;
  margin: 0 0 1rem;
  line-height: 1.4;
}

/* Wide tracking + large type so a 6-digit code stays readable at arm's length,
   outdoors, on a phone. This is the one input the whole flow depends on. */
#lk-code {
  font-size: var(--fs-xl, 1.5rem);
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-left: 0.4em; /* offsets trailing letter-spacing so digits look centred */
}

/* Two links share this row on the code step — space them so they don't collide
   on a narrow phone. */
#lk-code-form .lk-forgot-wrap {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
#lk-code-form .lk-link[disabled] { opacity: .5; cursor: default; }
