:root {
  --bg: #07070a;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #6366f1; /* Electric Indigo */
  --accent: #d946ef; /* Neon Violet */
  --cyber: #06b6d4; /* Cyber Cyan */
  --mint: #10b981;
  --danger: #ef4444;
  --font: 'Instrument Sans', sans-serif;
  --display: 'Space Grotesk', sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  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, textarea, select { font: inherit; }
.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 48px; }
.topbar, .hero, .tool-panel, .output-panel, .modal-card {
  border: 1px solid var(--line);
  background: rgba(7, 7, 10, 0.75);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 24px; border-radius: 999px; }
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  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));
}
.nav-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-actions a { color: var(--muted); text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 999px; transition: all 0.2s ease; }
.nav-actions a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.hero { margin: 22px 0; padding: clamp(28px, 6vw, 68px); border-radius: 34px; position: relative; overflow: hidden; }
.hero h1 { max-width: 850px; margin: 12px 0; font: 700 clamp(2.8rem, 7vw, 6rem)/0.95 var(--display); letter-spacing: -0.07em; background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { max-width: 620px; color: var(--muted); font-size: 1.08rem; }
.eyebrow { margin: 0; color: var(--gold); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.76rem; font-weight: 900; }
.credit-card {
  position: absolute;
  right: 34px;
  bottom: 34px;
  min-width: 160px;
  padding: 18px;
  border-radius: 24px;
  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; font-weight: 700; opacity: 0.7; }
.credit-card strong { display: block; font: 700 3.4rem/1 var(--display); color: var(--gold); }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-panel, .output-panel { border-radius: 28px; padding: 22px; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.tool-panel:hover { border-color: rgba(99, 102, 241, 0.3); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.05); }
.panel-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.panel-heading > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: rgba(99, 102, 241, 0.12); color: var(--gold); font-weight: 900; }
h2 { margin: 0; font: 700 1.7rem/1 var(--display); letter-spacing: -0.04em; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); }
textarea, input, select {
  width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; color: var(--text); background: rgba(255,255,255,0.03); outline: none; transition: all 0.2s ease;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--gold); background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
textarea { min-height: 290px; resize: vertical; line-height: 1.55; }
.control-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.file-drop { min-height: 290px; border: 1px dashed var(--line); border-radius: 22px; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); cursor: pointer; transition: all 0.2s ease; }
.file-drop:hover { border-color: var(--gold); background: rgba(99, 102, 241, 0.03); }
.file-drop input { display: none; }
.file-drop strong { display: block; color: var(--text); font-size: 1.2rem; }
.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(--gold); color: #ffffff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.primary-button:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45); }
.ghost-button { color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.ghost-button:hover:not(:disabled) { background: rgba(255,255,255,0.08); border-color: var(--muted); }
.primary-button:disabled, .ghost-button:disabled { opacity: 0.5; cursor: not-allowed; }
.output-panel { margin-top: 18px; }
.output-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.status { min-height: 22px; color: var(--muted); }
.status.error { color: var(--danger); }
pre { min-height: 260px; max-height: 620px; overflow: auto; white-space: pre-wrap; color: var(--text); background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 22px; padding: 18px; line-height: 1.6; }
.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(430px, 100%); border-radius: 28px; padding: 26px; position: relative; }
.close-button { position: absolute; right: 18px; top: 12px; border: 0; background: transparent; color: var(--text); font-size: 2rem; cursor: pointer; }
.auth-form { display: grid; gap: 10px; }
.wide { width: 100%; }
.divider { text-align: center; color: var(--muted); margin: 16px 0; }
@media (max-width: 820px) {
  .tools-grid { grid-template-columns: 1fr; }
  .credit-card { position: static; margin-top: 24px; width: max-content; }
  .topbar, .nav-actions, .output-header { align-items: stretch; flex-direction: column; }
  .control-row { grid-template-columns: 1fr; }
}

.pdf-upload-container {
  margin-bottom: 14px;
}
.pdf-upload-btn {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  transition: all 0.2s;
  font-size: 0.88rem;
  font-weight: 700;
}
.pdf-upload-btn:hover, .pdf-upload-btn.dragover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--gold);
  color: var(--text);
}

/* ==========================================
   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;
}

