:root {
  --bg: #07070a;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1; /* Electric Indigo */
  --accent: #d946ef; /* Neon Violet */
  --cyber: #06b6d4; /* Cyber Cyan */
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-body: 'Manrope', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% 8%, rgba(99, 102, 241, 0.15), transparent 38rem),
    radial-gradient(circle at 85% 18%, rgba(217, 70, 239, 0.12), transparent 32rem),
    radial-gradient(circle at 50% 60%, rgba(6, 182, 212, 0.08), transparent 40rem),
    linear-gradient(180deg, #09090b 0%, var(--bg) 52%, #020204 100%);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  z-index: -1;
}

button, input, select, textarea { font: inherit; }

.shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }

.topbar, .hero-panel, .editor-card, .result-card, .modal-card {
  border: 1px solid var(--line);
  background: rgba(7, 7, 10, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 28px;
  padding: 14px 24px;
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.35));
}

.auth-slot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-email { color: var(--muted); font-size: 0.9rem; }

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: end;
  margin: 22px 0;
  border-radius: 36px;
  padding: clamp(24px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  right: -130px;
  top: -140px;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, rgba(99, 102, 241, 0.08) 0 10px, transparent 10px 20px);
}

.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; }
h1 { max-width: 930px; font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 6.4rem); line-height: 0.92; letter-spacing: -0.06em; background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-copy { max-width: 680px; margin: 22px 0 0; color: var(--muted); font-size: 1.08rem; }

.credit-card {
  position: relative;
  z-index: 1;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(8px);
  color: var(--text);
  text-align: center;
}
.credit-card span, .credit-card small { display: block; color: var(--muted); }
.credit-card strong { display: block; font-family: var(--font-display); font-size: 4rem; line-height: 1; margin: 8px 0; color: var(--primary); }

.workspace { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr); gap: 22px; align-items: start; }
.editor-card, .result-card { border-radius: 30px; padding: 24px; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.editor-card:hover, .result-card:hover { border-color: rgba(99, 102, 241, 0.2); }
.editor-card { display: flex; flex-direction: column; gap: 18px; min-height: 680px; }

.field-row { display: flex; flex-direction: column; gap: 8px; }
.field-row.split { display: grid; grid-template-columns: 190px 1fr; gap: 14px; }
.field-row.grow { flex: 1; }
label { font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: all 0.2s ease;
}
textarea { flex: 1; min-height: 380px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }

.action-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
}
.primary-button { background: var(--primary); color: #ffffff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.primary-button:hover:not(:disabled) { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45); }
.ghost-button { background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--line); }
.ghost-button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: var(--muted); transform: translateY(-1px); }
.primary-button:disabled, .ghost-button:disabled { cursor: not-allowed; opacity: 0.52; transform: none; box-shadow: none; }
.wide { width: 100%; }
.status-message { min-height: 22px; margin: 0; color: var(--muted); font-size: 0.92rem; }
.status-message.error { color: var(--danger); }

.result-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 18px; }
.result-header h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 3rem); line-height: 0.98; letter-spacing: -0.05em; color: var(--text); }
.summary-box { border-left: 5px solid var(--accent); background: rgba(217, 70, 239, 0.08); color: var(--muted); padding: 16px; border-radius: 16px; margin-bottom: 18px; }
.rewritten-cv { min-height: 300px; max-height: 620px; overflow: auto; white-space: pre-wrap; margin: 0; padding: 20px; border-radius: 22px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); line-height: 1.6; color: var(--text); }
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.insight-grid section { border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); padding: 16px; }
.insight-grid h3 { font-size: 0.98rem; margin-bottom: 10px; color: var(--text); }
ul { margin: 0; padding-left: 18px; color: var(--muted); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; background: rgba(99, 102, 241, 0.12); color: var(--primary); padding: 6px 10px; font-size: 0.86rem; font-weight: 800; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.56); z-index: 20; }
.hidden { display: none !important; }
.modal-card { width: min(440px, 100%); border-radius: 28px; padding: 28px; position: relative; }
.modal-card h2 { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; letter-spacing: -0.04em; color: var(--text); }
.modal-card p { color: var(--muted); }
.modal-close { position: absolute; right: 18px; top: 14px; border: 0; background: transparent; font-size: 2rem; cursor: pointer; color: var(--text); }
.auth-form { display: grid; gap: 10px; }
.divider { color: var(--muted); text-align: center; margin: 16px 0; }

@media (max-width: 980px) {
  .hero-panel, .workspace { grid-template-columns: 1fr; }
  .field-row.split, .insight-grid { grid-template-columns: 1fr; }
  .editor-card { min-height: unset; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 18px, 1480px); padding-top: 10px; }
  .topbar, .auth-slot, .action-row, .result-header { align-items: stretch; flex-direction: column; }
  h1 { font-size: 3rem; }
  .hero-panel, .editor-card, .result-card { border-radius: 22px; padding: 18px; }
  .credit-card strong { font-size: 3rem; }
}

/* ==========================================
   Premium Light-Theme Auth Modal (White UI)
   ========================================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.auth-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-modal-card {
  width: min(100%, 420px);
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  padding: 2rem !important;
  position: relative !important;
  transform: translateY(0);
  transition: transform 0.25s ease;
  color: #0f172a !important;
}
.auth-modal-overlay.hidden .auth-modal-card {
  transform: translateY(16px);
}
.auth-modal-close {
  position: absolute;
  right: 1.25rem;
  top: 1.25rem;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.15s ease;
}
.auth-modal-close:hover {
  color: #0f172a;
}
.auth-modal-title {
  font-family: 'Space Grotesk', 'Manrope', sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 1.5rem !important;
  text-align: center !important;
  letter-spacing: -0.02em !important;
}

/* Tab Switcher at the top */
.auth-tabs-container {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.5rem;
}
.auth-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
}
.auth-tab-btn:hover:not(.active) {
  color: #334155;
}
.auth-tab-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Inputs & Labels */
.auth-input-group {
  margin-bottom: 1.25rem;
}
.auth-input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  text-align: left;
}
.auth-input-field {
  width: 100% !important;
  padding: 10px 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 0.95rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.auth-input-field:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none !important;
}
.auth-input-field::placeholder {
  color: #94a3b8 !important;
}

/* Buttons */
.auth-btn-primary {
  width: 100% !important;
  padding: 11px !important;
  border: none !important;
  border-radius: 10px !important;
  background: #1e293b !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}
.auth-btn-primary:hover {
  background: #0f172a !important;
}
.auth-btn-social {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}
.auth-btn-social:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.auth-divider-line {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
}
.auth-divider-line::before,
.auth-divider-line::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}
.auth-divider-line span {
  padding: 0 12px;
}

.auth-switch-desc {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
}
.auth-switch-desc a {
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
}
.auth-switch-desc a:hover {
  text-decoration: underline;
}

/* Success and confirmation screens */
.auth-success-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.auth-confirm-email {
  color: #6366f1;
  font-weight: 700;
}

.auth-success-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: #e0e7ff;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}
