/* ── LoginPage styles (scoped under .login-page) ── */

/* Login-specific palette — hardcoded, theme-independent (renders before user picks a theme) */
.login-page {
  --login-bg: #fbf6f4;
  --login-bg-dark: #130c0e;
  --login-text: #201514;
  --login-text2: #624d4a;
  --login-muted: #9c9087;
  --login-border: #e6d8d2;
  --login-placeholder: #c4bcb3;
  --login-rose: #7c2d3a;
  --login-rose-light: #b55b72;
  --login-feature-desc: #6b5e56;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

/* ── ANIMATIONS ── */
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes loginSpin { to { transform: rotate(360deg); } }
@keyframes loginBlob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(40px,-30px) scale(1.1); }
  70%     { transform: translate(-20px,22px) scale(0.93); }
}
@keyframes loginBlob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  35%     { transform: translate(-35px,25px) scale(1.07); }
  68%     { transform: translate(18px,-16px) scale(0.95); }
}

.login-page .anim {
  opacity: 0;
  animation: loginFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ── LEFT PANEL ── */
.login-page .left-panel {
  width: 44%;
  height: 100vh;
  background: var(--login-bg);
  display: flex;
  flex-direction: column;
  padding: 64px;
  position: relative;
  flex-shrink: 0;
}

/* Grain texture — matches landing site paper feel */
.login-page .left-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 250px;
  opacity: 0.038;
}

.login-page .left-logo,
.login-page .left-content,
.login-page .left-footer {
  position: relative;
  z-index: 1;
}

.login-page .left-logo {
  display: flex;
  align-items: center;
  gap: 0;
}

.login-page .logo-name {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--login-text);
  letter-spacing: -0.01em;
}

.login-page .left-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 340px;
}

.login-page .left-heading {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--login-text);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.login-page .left-sub {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--login-text2);
  margin-bottom: 36px;
  line-height: 1.6;
}

.login-page .field {
  margin-bottom: 16px;
}

.login-page .field label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--login-muted);
  margin-bottom: 8px;
}

.login-page .field input {
  width: 100%;
  padding: 13px 16px;
  background: white;
  border: 1.5px solid var(--login-border);
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--login-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-page .field input:focus {
  border-color: var(--login-rose);
  box-shadow: 0 0 0 3px rgba(124,45,58,0.09);
}

.login-page .field input::placeholder {
  color: var(--login-placeholder);
}

.login-page .login-error {
  display: none;
  background: rgba(124,45,58,0.08);
  border: 1px solid rgba(124,45,58,0.2);
  color: var(--login-rose);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
  animation: loginFadeUp 0.2s ease;
}
.login-page .login-error.show { display: block; }

/* Success message (green) */
.login-page .login-success {
  display: none;
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.2);
  color: #16a34a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
  animation: loginFadeUp 0.2s ease;
}
.login-page .login-success.show { display: block; }

/* Google sign-in button */
.login-page .btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: white;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--login-text);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.login-page .btn-google:hover {
  background: #f9f8f6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* "or" divider */
.login-page .social-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
}
.login-page .social-divider::before,
.login-page .social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--login-border);
}
.login-page .social-divider span {
  padding: 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--login-muted);
  text-transform: lowercase;
}

/* Auth links row (e.g. Forgot password?) */
.login-page .auth-links {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 12px;
}

/* Inline link button */
.login-page .auth-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--login-rose);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.login-page .auth-link:hover { text-decoration: underline; }

/* Switch text (already have account? / don't have one?) */
.login-page .auth-switch {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--login-muted);
  margin-top: 20px;
}

/* Verify screen */
.login-page .verify-screen {
  text-align: center;
  padding: 20px 0;
}
.login-page .verify-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}
.login-page .verify-screen p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--login-text2);
  line-height: 1.6;
  margin: 0 0 8px;
}
.login-page .verify-note {
  font-size: 13px !important;
  color: var(--login-muted) !important;
  margin-bottom: 24px !important;
}

/* Secondary button style (used for resend) */
.login-page .btn-secondary {
  background: transparent;
  color: var(--login-rose);
  border: 1px solid var(--login-rose);
  box-shadow: none;
}
.login-page .btn-secondary:hover {
  background: rgba(124,45,58,0.05);
  box-shadow: none;
  transform: none;
}

.login-page .btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--login-rose), var(--login-rose-light));
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 18px rgba(124,45,58,0.32);
}

.login-page .btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124,45,58,0.42);
}

.login-page .btn-login:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(124,45,58,0.28);
}

.login-page .btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-page .login-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: loginSpin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

.login-page .left-footer {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--login-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.login-page .left-footer-legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.login-page .left-footer-link {
  color: var(--login-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.login-page .left-footer-link:hover {
  color: var(--login-text);
  text-decoration: underline;
}

/* ── RIGHT PANEL ── */
.login-page .right-panel {
  flex: 1;
  height: 100vh;
  background: var(--login-bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  position: relative;
  overflow: hidden;
}

.login-page .right-glow {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(124,45,58,0.14) 0%, transparent 65%);
  pointer-events: none;
  animation: loginBlob1 14s ease-in-out infinite;
}

/* Second ambient blob — bottom left */
.login-page .right-panel::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(ellipse, rgba(124,45,58,0.08) 0%, transparent 65%);
  pointer-events: none;
  animation: loginBlob2 17s ease-in-out infinite;
}

.login-page .right-content {
  position: relative;
  z-index: 1;
}

.login-page .right-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--login-rose-light);
  margin-bottom: 16px;
}

.login-page .right-headline {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 52px;
}

.login-page .right-headline .line-white { color: white; display: block; }
.login-page .right-headline .line-rose  { color: var(--login-rose-light); display: block; }

.login-page .features {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-page .feature-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.login-page .feature-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(124,45,58,0.15);
  border: 1px solid rgba(124,45,58,0.20);
  color: var(--login-rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.login-page .feature-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.login-page .feature-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--login-feature-desc);
  line-height: 1.55;
}

/* ── RESPONSIVE ── */

/* Tablet: tighten padding, scale down headline */
@media (max-width: 900px) {
  .login-page .left-panel  { padding: 48px 40px; }
  .login-page .right-panel { padding: 48px 44px; }
  .login-page .right-headline { font-size: 34px; }
}

/* Mobile: stack vertically — right panel becomes compact header */
@media (max-width: 640px) {
  .login-page {
    flex-direction: column;
    overflow-y: auto;
  }

  /* Right panel sits above as a compact brand header */
  .login-page .right-panel {
    width: 100%;
    height: auto;
    padding: 48px 28px 40px;
    order: -1;
    flex: none;
  }

  /* Left panel fills remaining space */
  .login-page .left-panel {
    width: 100%;
    height: auto;
    padding: 40px 28px 48px;
    flex: none;
  }

  .login-page .left-content {
    max-width: 100%;
    justify-content: flex-start;
  }

  /* Compact headline on mobile */
  .login-page .right-headline {
    font-size: 32px;
    margin-bottom: 0;
  }

  /* Hide features — secondary content not needed on mobile */
  .login-page .features { display: none; }

  /* Hide eyebrow on mobile to keep header minimal */
  .login-page .right-eyebrow { display: none; }
}

/* ── Workspace loading screen ─────────────────────────────────────────────── */
/* Uses theme CSS vars from <html> — inherits whatever theme is active.       */
.workspace-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-ui);
}

.workspace-loading-screen::before,
.workspace-loading-screen::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
}

.workspace-loading-screen::before {
  width: 380px;
  height: 380px;
  top: -140px;
  right: -90px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 68%);
}

.workspace-loading-screen::after {
  width: 300px;
  height: 300px;
  bottom: -110px;
  left: -70px;
  background: radial-gradient(circle, color-mix(in srgb, var(--text) 8%, transparent), transparent 70%);
}

.workspace-loading-shell {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 32px));
  padding: 34px 30px 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(14px);
  text-align: center;
}

.workspace-loading-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-top-color: var(--accent);
  animation: loginSpin 0.8s linear infinite;
}

.workspace-loading-title {
  margin-bottom: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.workspace-loading-copy {
  max-width: 320px;
  margin: 0 auto;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .workspace-loading-shell {
    width: min(420px, calc(100vw - 24px));
    padding: 28px 22px 26px;
    border-radius: 20px;
  }

  .workspace-loading-title {
    font-size: 24px;
  }

  .workspace-loading-copy {
    font-size: 13px;
  }
}
