/* Log in page. Layout, step transitions and the welcome back panel. Built on cadi.css tokens. */

body.lg { margin: 0; background: var(--surface); }
.lg-page { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; background: var(--surface); color: var(--text); }

/* ---------- Left column ---------- */
.lg-left { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; padding: 32px 56px; }
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lg-top .brand-lockup { min-height: 44px; }
.lg-top .wordmark { font-size: 24px; line-height: 1; }
.lg-tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.lg-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.lg-col { width: 100%; max-width: 440px; outline: none; }
.lg-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.lg-foot-links { display: inline-flex; gap: 20px; }
.lg-foot a { color: var(--text-3); min-height: 44px; display: inline-flex; align-items: center; }
.lg-foot a:hover { color: var(--text); }

/* ---------- Steps ---------- */
.lg-step { display: flex; flex-direction: column; }
.lg-step > * { animation: fadeUp .64s var(--ease) both; }
.lg-step > *:nth-child(2) { animation-delay: .05s; }
.lg-step > *:nth-child(3) { animation-delay: .10s; }
.lg-step > *:nth-child(4) { animation-delay: .15s; }
.lg-step > *:nth-child(5) { animation-delay: .20s; }
.lg-step > *:nth-child(6) { animation-delay: .25s; }
.lg-step > *:nth-child(7) { animation-delay: .30s; }
.lg-step > *:nth-child(8) { animation-delay: .35s; }
.lg-step > *:nth-child(9) { animation-delay: .40s; }
.lg-step.is-back > * { animation-name: lgFadeIn; }
.lg-tabin { display: flex; flex-direction: column; animation: fadeUp .42s var(--ease) both; }
@keyframes lgFadeIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.lg-dots { margin-bottom: 20px; min-height: 12px; }
.lg-h1 { margin: 0; font-size: 40px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.lg-lede { margin: 12px 0 28px; color: var(--text-2); font-size: 16px; line-height: 1.6; }
.lg-lede .mono { font-size: 14.5px; color: var(--text); overflow-wrap: anywhere; }
.lg-step .seg { align-self: flex-start; width: fit-content; max-width: 100%; margin-bottom: 24px; background: var(--surface-2); }

.lg-step .inp, .lg-step .inp-group { height: 52px; }
.lg-remember { align-self: flex-start; margin-top: 8px; color: var(--text-2); font-size: 14px; }
.lg-go { margin-top: 12px; }
.lg-error { margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--danger); display: flex; align-items: flex-start; gap: 8px; }
.lg-error[hidden] { display: none; }
.lg-error .ic { margin-top: 2px; }

.lg-or { display: flex; align-items: center; gap: 14px; margin: 24px 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lg-two .btn, .lg-passkey { height: 48px; justify-content: center; gap: 10px; }
.lg-two .btn { padding: 0 12px; }
.lg-two .btn .pill { margin-left: 2px; }
.lg-passkey {
  margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 12px 0 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--hover); color: var(--text-2);
  font: 600 15px var(--font-ui); text-align: left; cursor: not-allowed; opacity: .75;
}
.lg-passkey .grow { flex: 1; min-width: 0; }
.lg-passkey .ic { color: var(--text-3); }
.lg-new { margin: 24px 0 0; font-size: 14px; color: var(--text-2); text-align: center; }
.lg-new a { font-weight: 600; text-decoration: underline; text-decoration-color: rgba(91, 75, 224, .3); text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.lg-new a:hover { text-decoration-color: var(--primary-hover); }
.lg-legal { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--surface-2); font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.lg-legal strong { color: var(--text-2); font-weight: 600; }

/* Phone tab: coming soon */

/* ---------- Code boxes ---------- */
.lg-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.lg-otp .inp {
  width: 100%; height: 64px; padding: 0; text-align: center; border-radius: var(--r-lg);
  font: 600 24px var(--font-mono); letter-spacing: 0; caret-color: var(--primary);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.lg-otp .inp.is-filled { border-color: var(--border-strong); }
.lg-otp .inp:focus { transform: translateY(-1px); }
.lg-otp.is-bad .inp { border-color: var(--danger); animation: lgShake .42s var(--ease) both; }
.lg-otp.is-bad .inp:focus { box-shadow: 0 0 0 4px rgba(196, 50, 43, .15); }
@keyframes lgShake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

.lg-codebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.lg-timer, .lg-resend { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); min-height: 44px; }
.lg-resend { border: 0; background: transparent; padding: 0 6px; margin-left: -6px; border-radius: 6px; color: var(--accent); font-weight: 500; cursor: pointer; animation: fadeUp .5s var(--ease) both; }
.lg-resend:hover { color: var(--primary-hover); }
.lg-resend:focus-visible { box-shadow: var(--ring); outline: none; }
.lg-resend:disabled { opacity: .5; cursor: progress; }
.lg-dev { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); user-select: all; }
.lg-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.lg-actions .btn-lg { min-width: 168px; }
.lg-link { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; border-radius: 6px; }
.lg-link:hover { color: var(--primary-hover); }
.lg-link:focus-visible { box-shadow: var(--ring); outline: none; }

/* ---------- Done ---------- */
.lg-check { position: relative; width: 56px; height: 56px; margin-bottom: 24px; }
.lg-check::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--success); animation: lgRing 1.2s var(--ease) .35s both; }
.lg-check span { position: absolute; inset: 0; border-radius: 50%; background: var(--success-bg); color: var(--success); display: flex; align-items: center; justify-content: center; animation: lgCheck .7s var(--ease) .1s both; }
@keyframes lgRing { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
@keyframes lgCheck { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }

/* ---------- Right panel ---------- */
.lg-panel {
  flex: 1 1 480px; min-width: 0; min-height: 928px; margin: 16px; border-radius: 28px; position: relative; overflow: hidden;
  background-color: var(--surface-2); background-image: radial-gradient(rgba(20, 18, 37, .07) 1px, transparent 1px); background-size: 22px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 88px 24px 56px;
}
.lg-ptop { position: absolute; top: 24px; left: 24px; right: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-status { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.lg-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--placeholder); }
.lg-status.is-live i { background: var(--success); animation: lgPulse 1.6s var(--ease) infinite; }
@keyframes lgPulse { 0% { box-shadow: 0 0 0 0 rgba(15, 138, 74, .45); } 100% { box-shadow: 0 0 0 7px rgba(15, 138, 74, 0); } }
.lg-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--text); max-width: 60%; }
.lg-chip .ic { color: var(--text-3); }
.lg-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lg-pstack { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.lg-rise { animation: fadeUp .7s var(--ease) both; }
.lg-rise.d1 { animation-delay: .08s; } .lg-rise.d2 { animation-delay: .16s; } .lg-rise.d3 { animation-delay: .24s; }
.lg-float { display: flex; justify-content: center; margin-bottom: 8px; }
.lg-float > span { display: inline-flex; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); animation: float 6s ease-in-out infinite; }
.lg-ucard { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 24px 24px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.lg-ucard img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: block; background: var(--primary-soft); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.lg-ucard h2 { margin: 16px 0 0; font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; max-width: 100%; overflow-wrap: anywhere; }
.lg-ucard p { margin: 4px 0 0; font-size: 14.5px; color: var(--text-2); }
.lg-handle { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; color: var(--text-2); max-width: 100%; }
.lg-handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-notyou { align-self: center; }

/* Calm brand panel */
.lg-brand { text-align: center; align-items: center; padding: 8px 8px 0; }
.lg-brand .lg-bigmark { display: inline-flex; padding: 28px; border-radius: 32px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); animation: float 6s ease-in-out infinite; }
.lg-brand h2 { margin: 28px 0 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
.lg-brand p { margin: 8px 0 0; font-size: 15px; color: var(--text-2); max-width: 300px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .lg-left { padding: 28px 32px; } }
@media (max-width: 900px) {
  .lg-left { padding: 20px 16px 24px; flex-basis: 100%; }
  .lg-center { padding: 24px 0; align-items: flex-start; }
  .lg-foot { display: none; }
  .lg-panel { min-height: 0; margin: 0 16px 16px; padding: 72px 16px 40px; flex-basis: 100%; }
  .lg-panel.is-brand { display: none; }
}
@media (max-width: 520px) {
  .lg-h1 { font-size: 32px; }
  .lg-otp { gap: 6px; }
  .lg-otp .inp { height: 56px; font-size: 22px; }
  .lg-two { grid-template-columns: minmax(0, 1fr); }
  .lg-actions .btn-lg { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-float > span, .lg-brand .lg-bigmark, .lg-status.is-live i, .lg-otp.is-bad .inp, .lg-check::before, .lg-check span { animation: none !important; }
  .lg-otp .inp { transition: none !important; }
}

/* Phone tab */
.lg-switch { align-self: flex-start; margin-top: 10px; }
.lg-switch[hidden] { display: none; }
#lgPhoneGroup .cc-btn { height: 100%; }
