/* CrackIt AI — Auth page styles (Phase C)
   Two-column layout: form left, visual right on desktop >=980px.
   Uses tokens.css variables. */

/* ═══ Auth Shell ═══ */
.ck-auth-shell {
  min-height: 100vh;
  display: flex;
  background: var(--ck-surface);
  font-family: var(--ck-font);
  color: var(--ck-ink);
}

/* ═══ Form Side ═══ */
.ck-auth-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--ck-space-6) clamp(20px, 4vw, 48px) var(--ck-space-6);
}

/* Top bar: logo + toggle link */
.ck-auth-topbar {
  display: flex;
  align-items: center;
  gap: var(--ck-space-3);
  min-height: 40px;
}
.ck-auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ck-ink);
  text-decoration: none;
}
.ck-auth-logo:hover { text-decoration: none; }
.ck-auth-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--ck-radius-md);
  background: var(--ck-primary);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--ck-primary-hover);
}
.ck-auth-logo-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ck-auth-top-prompt {
  font-size: var(--ck-text-sm);
  color: oklch(0.5 0.015 255);
}
.ck-auth-top-link {
  border: 1px solid var(--ck-rule-strong);
  background: var(--ck-surface);
  height: 34px;
  padding: 0 13px;
  border-radius: var(--ck-radius-md);
  font-weight: 600;
  font-size: var(--ck-text-sm);
  cursor: pointer;
  color: inherit;
  white-space: nowrap;
}
.ck-auth-top-link:hover {
  background: oklch(0.965 0.006 250);
}

/* Center area */
.ck-auth-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ck-space-10) 0;
}
.ck-auth-card {
  width: 100%;
  max-width: 400px;
}

/* Footer */
.ck-auth-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--ck-space-3);
  flex-wrap: wrap;
  font-size: 12.5px;
  color: oklch(0.55 0.015 255);
}
.ck-auth-footer a {
  color: oklch(0.55 0.015 255);
  text-decoration: none;
}
.ck-auth-footer a:hover {
  text-decoration: underline;
}
.ck-auth-footer-links {
  display: flex;
  gap: 18px;
}

/* ═══ Headings ═══ */
.ck-auth-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ck-auth-sub {
  margin: 8px 0 0;
  font-size: var(--ck-text-base);
  line-height: 1.55;
  color: var(--ck-ink-secondary);
}

/* ═══ Form ═══ */
.ck-auth-form {
  display: grid;
  gap: var(--ck-space-4);
  margin-top: var(--ck-space-6);
}
.ck-auth-field {
  display: grid;
  gap: 6px;
}
.ck-auth-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--ck-space-2);
}
.ck-auth-label {
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.35 0.02 255);
}
.ck-auth-field-aux {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: oklch(0.42 0.1 180);
  cursor: pointer;
}
.ck-auth-field-aux:hover {
  text-decoration: underline;
}

/* Input wrapper for password toggle */
.ck-auth-input-wrap {
  position: relative;
}
.ck-auth-input-wrap input {
  width: 100%;
  padding-right: 46px;
}

.ck-auth-input {
  width: 100%;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--ck-rule-strong);
  padding: 0 14px;
  font-size: var(--ck-text-base);
  outline: 0;
  background: var(--ck-surface);
  color: inherit;
  transition: border-color 150ms, box-shadow 150ms;
}
.ck-auth-input:focus {
  border-color: var(--ck-primary);
  box-shadow: 0 0 0 4px oklch(0.93 0.04 178);
}
.ck-auth-input--error {
  border-color: oklch(0.8 0.08 28);
}
.ck-auth-input[readonly] {
  background: var(--ck-ground);
  color: var(--ck-ink-secondary);
  cursor: default;
}

/* Password toggle button */
.ck-auth-pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: oklch(0.42 0.1 180);
  cursor: pointer;
  border-radius: var(--ck-radius-sm);
}
.ck-auth-pw-toggle:hover {
  background: oklch(0.96 0.01 250);
}

/* ═══ Password Strength ═══ */
.ck-auth-strength {
  display: grid;
  gap: 6px;
  margin-top: -6px;
}
.ck-auth-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.ck-auth-strength-bar {
  height: 4px;
  border-radius: var(--ck-radius-pill);
  background: oklch(0.93 0.008 250);
  transition: background var(--ck-duration-fast);
}
.ck-auth-strength-bar--active {
  background: var(--ck-primary);
}
.ck-auth-strength-bar--warn {
  background: var(--ck-amber);
}
.ck-auth-strength-text {
  font-size: 12.5px;
  color: oklch(0.5 0.015 255);
}

/* ═══ Error Alert ═══ */
.ck-auth-error {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 12px;
  background: oklch(0.958 0.025 25);
  color: oklch(0.46 0.15 28);
  font-size: var(--ck-text-sm);
  line-height: 1.45;
}
.ck-auth-error[hidden] { display: none; }
.ck-auth-error svg { flex: none; margin-top: 1px; }
.ck-auth-error-body { display: grid; gap: 6px; min-width: 0; }
.ck-auth-error-msg { font-weight: 600; }
.ck-auth-error-sub { color: oklch(0.42 0.08 28); }
.ck-auth-error-actions {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.ck-auth-error-action {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: oklch(0.4 0.14 28);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.ck-auth-error-action:hover {
  color: oklch(0.32 0.12 28);
}

/* ═══ Buttons ═══ */
.ck-auth-submit-row {
  display: flex;
  gap: var(--ck-space-2);
  margin-top: 6px;
}
.ck-auth-submit {
  flex: 2;
  border: 0;
  height: 48px;
  border-radius: 12px;
  background: oklch(0.25 0.03 255);
  color: #fff;
  font-weight: 600;
  font-size: var(--ck-text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 6px oklch(0.2 0.03 255 / .2);
  transition: background 150ms;
}
.ck-auth-submit:hover {
  background: oklch(0.32 0.035 255);
}
.ck-auth-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}
.ck-auth-cancel {
  flex: 1;
  border: 1px solid var(--ck-rule-strong);
  background: var(--ck-surface);
  height: 48px;
  border-radius: 12px;
  font-weight: 600;
  font-size: var(--ck-text-base);
  cursor: pointer;
  color: inherit;
}
.ck-auth-cancel:hover {
  background: oklch(0.965 0.006 250);
}

/* Spinner inside button */
.ck-auth-spinner {
  width: 15px;
  height: 15px;
  border-radius: var(--ck-radius-pill);
  border: 2px solid oklch(1 0 0 / .35);
  border-top-color: #fff;
  animation: ck-spin .7s linear infinite;
}

/* ═══ Legal / Note text ═══ */
.ck-auth-legal {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: oklch(0.5 0.015 255);
  text-wrap: pretty;
}
.ck-auth-legal a {
  color: oklch(0.36 0.075 180);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ═══ Below-form link ═══ */
.ck-auth-below {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--ck-text-sm);
}
.ck-auth-below-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: var(--ck-text-sm);
  font-weight: 600;
  color: oklch(0.42 0.1 180);
  cursor: pointer;
}
.ck-auth-below-link:hover {
  text-decoration: underline;
}

/* ═══ Success / Done State ═══ */
.ck-auth-done {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.ck-auth-done-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--ck-radius-pill);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, oklch(0.62 0.13 165), oklch(0.48 0.11 180));
  box-shadow: 0 10px 30px oklch(0.5 0.11 175 / .35);
  transform: scale(var(--ck-done-scale, 0.6));
  transition: transform 550ms cubic-bezier(.3, 1.6, .5, 1);
}
.ck-auth-done-icon--visible {
  --ck-done-scale: 1;
}
.ck-auth-done-title {
  margin: 14px 0 0;
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ck-auth-done-text {
  margin: 0;
  font-size: var(--ck-text-base);
  line-height: 1.6;
  color: var(--ck-ink-secondary);
}
.ck-auth-done-actions {
  display: flex;
  gap: var(--ck-space-2);
  margin-top: var(--ck-space-4);
  flex-wrap: wrap;
}
.ck-auth-done-primary {
  border: 0;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  background: oklch(0.25 0.03 255);
  color: #fff;
  font-weight: 600;
  font-size: var(--ck-text-base);
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.ck-auth-done-primary:hover {
  background: oklch(0.32 0.035 255);
}

/* ═══ Info box (invite context) ═══ */
.ck-auth-info {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: oklch(0.975 0.006 250);
  border: 1px solid oklch(0.93 0.007 250);
}
.ck-auth-info-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--ck-radius-pill);
  flex: none;
  display: grid;
  place-items: center;
  background: var(--ck-primary);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
}
.ck-auth-info-text {
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

/* ═══ Checking / Loading state ═══ */
.ck-auth-checking {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: var(--ck-space-10) 0;
}
.ck-auth-checking-spinner {
  width: 40px;
  height: 40px;
  border-radius: var(--ck-radius-pill);
  border: 3px solid oklch(0.93 0.01 250);
  border-top-color: var(--ck-primary);
  animation: ck-spin .8s linear infinite;
}
.ck-auth-checking-text {
  font-size: var(--ck-text-base);
  font-weight: 600;
}

/* ═══ Visual Side (right panel) ═══ */
.ck-auth-visual {
  flex: 0 0 min(46%, 640px);
  margin: 12px;
  border-radius: 24px;
  background: oklch(0.17 0.022 255);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 4vw, 56px);
}
.ck-auth-visual-glow {
  position: absolute;
  left: -10%;
  top: -30%;
  width: 120%;
  height: 80%;
  background: radial-gradient(ellipse at center, oklch(0.5 0.1 185 / .35), transparent 62%);
  pointer-events: none;
}
.ck-auth-visual-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(oklch(1 0 0 / .04) 1px, transparent 1px),
                     linear-gradient(90deg, oklch(1 0 0 / .04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 40% 20%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 40% 20%, #000, transparent 75%);
  pointer-events: none;
}
.ck-auth-visual-headline {
  position: relative;
  margin: 0;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: 14ch;
  background: linear-gradient(180deg, #fff 30%, oklch(0.8 0.02 240));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ck-auth-visual-card {
  position: relative;
  margin-top: 36px;
  border-radius: 18px;
  background: oklch(0.22 0.028 255);
  border: 1px solid oklch(1 0 0 / .08);
  padding: 18px;
  box-shadow: 0 30px 80px oklch(0 0 0 / .35);
  max-width: 440px;
}
.ck-auth-visual-tagline {
  position: relative;
  margin-top: 28px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: oklch(0.72 0.012 250);
}

/* ═══ Verification Banner ═══ */
.ck-verify-banner {
  flex: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 8px 16px;
  background: oklch(0.95 0.06 80);
  color: oklch(0.34 0.075 60);
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px solid oklch(0.88 0.07 80);
}
.ck-verify-banner[hidden] { display: none; }
.ck-verify-banner-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ck-verify-banner-msg b {
  font-weight: 600;
}
.ck-verify-banner-action {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.ck-verify-resend-btn {
  border: 0;
  background: transparent;
  height: 36px;
  padding: 0 6px;
  margin: 0 -6px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: oklch(0.4 0.1 180);
  cursor: pointer;
}
.ck-verify-resend-btn:hover {
  text-decoration: underline;
  background: oklch(0.92 0.07 80);
}
.ck-verify-sending {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.ck-verify-sent {
  font-weight: 600;
  color: oklch(0.42 0.12 150);
}
.ck-verify-failed {
  font-weight: 600;
  color: oklch(0.48 0.16 28);
}

/* ═══ Account Settings ═══ */
.ck-settings-section {
  margin-bottom: var(--ck-space-8);
}
.ck-settings-section-title {
  font-size: var(--ck-text-lg);
  font-weight: 600;
  margin-bottom: var(--ck-space-4);
}
.ck-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ck-space-4);
}
.ck-settings-field {
  display: grid;
  gap: 4px;
}
.ck-settings-field-label {
  font-size: var(--ck-text-sm);
  color: var(--ck-ink-secondary);
  font-weight: 500;
}
.ck-settings-field-value {
  font-size: var(--ck-text-base);
  font-weight: 500;
}
.ck-settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--ck-radius-pill);
}
.ck-settings-badge--unverified {
  background: var(--ck-amber-tint);
  color: oklch(0.4 0.1 70);
}
.ck-settings-badge--verified {
  background: var(--ck-green-tint);
  color: oklch(0.35 0.12 145);
}

/* ═══ Responsive: hide visual side below 980px ═══ */
@media (max-width: 979px) {
  .ck-auth-visual { display: none; }
  .ck-auth-top-prompt { display: none; }
}

@media (max-width: 600px) {
  .ck-settings-grid {
    grid-template-columns: 1fr;
  }
  .ck-verify-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 16px;
  }
  .ck-verify-banner-action {
    padding-left: 26px;
  }
}

/* ═══ Keyframes ═══ */
@keyframes ck-spin {
  to { transform: rotate(360deg); }
}
