/* ============================================================
   RPE Settings Generator
   Theme: Lytix Audit Layout + Phigros Font + Pure Black
   ============================================================ */

/* ── Font ───────────────────────────────────────────── */
@font-face {
  font-family: 'Phigros';
  src: url('phigros-font.ttf') format('truetype');
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --black:         #000000;
  --black-soft:    #0a0a0a;
  --card-bg:       #0d0d0d;
  --input-bg:      #111111;
  --line:          rgba(255,255,255,0.10);
  --line-strong:   rgba(255,255,255,0.18);
  --line-focus:    rgba(255,255,255,0.40);

  --text:          #f5f5f5;
  --text-sub:      #999;
  --text-muted:    #555;

  --accent:        #ffffff;
  --accent-dim:    rgba(255,255,255,0.50);

  --radius:        4px;

  --font-display:  'Phigros', 'Noto Serif SC', 'STSong', serif;
  --font-mono:     'Phigros', 'Consolas', monospace;
  --font-ui:       'Phigros', system-ui, sans-serif;

  --t: 0.15s ease;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--black);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Layout ─────────────────────────────────────────── */
#app { position: relative; z-index: 1; }
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ═════════════════════════════════════════════════════
   HERO
   ═════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 80px 24px 48px;
}

.hero-logo {
  width: 56px;
  opacity: 0.85;
  margin: 0 auto 16px;
  display: block;
  filter: grayscale(1) brightness(1.2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 36px;
}

.hero-rule {
  width: 1px;
  height: 40px;
  background: var(--line-strong);
  margin: 0 auto 20px;
}

.hero-desc {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-sub);
  max-width: 560px;
  margin: 0 auto;
}

.hero-desc .fn {
  font-family: var(--font-display);
  color: var(--accent-dim);
}

/* ═════════════════════════════════════════════════════
   FORM
   ═════════════════════════════════════════════════════ */
#quiz-form { padding-bottom: 80px; }

/* ── Header ─── */
.form-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 32px 0 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.form-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Sections ─── */
.q-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.q-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 32px;
}

.question-item {
  margin-bottom: 36px;
}

.question-item:last-child { margin-bottom: 0; }

.q-label {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
  display: block;
}

.q-hint-inline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0.03em;
}

/* ── Info Grid ─── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}

@media (max-width: 600px) { .info-grid { grid-template-columns: 1fr; } }

/* ── Drop Zone (Lytix upload style) ─── */
.drop-zone {
  border: 1px dashed var(--line);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  margin-bottom: 32px;
  transition: border-color var(--t), background var(--t);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-dim);
  background: rgba(255,255,255,0.02);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(255,255,255,0.04);
}

.drop-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.drop-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-sub);
}

.drop-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.drop-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-top: 10px;
  min-height: 1em;
  transition: color var(--t);
}

.drop-status:empty { display: none; }

.drop-status.loading { color: var(--text-sub); }
.drop-status.success { color: #0f0; }
.drop-status.error   { color: #f44; }

/* ── Inputs ─── */
.form-input[type="text"],
.form-input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 8px 0;
  outline: none;
  border-radius: 0;
  transition: border-color var(--t);
}

.form-input[type="text"]:focus,
.form-input[type="number"]:focus {
  border-bottom-color: var(--accent);
}

.form-input[type="text"]::placeholder,
.form-input[type="number"]::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Range ─── */
.form-input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 320px;
  height: 2px;
  background: var(--line-strong);
  outline: none;
  margin-top: 4px;
}

.form-input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--t);
}

.form-input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.form-input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.range-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-left: 12px;
  display: inline-block;
  vertical-align: middle;
}

/* ── Radio Group (Lytix style) ─── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-sub);
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t), border-color var(--t);
}

.radio-item:hover {
  color: var(--text);
}

.radio-item.selected {
  color: var(--accent);
  border-bottom-color: var(--line);
}

.radio-item input { display: none; }

.radio-dot {
  width: 12px; height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  transition: border-color var(--t), background var(--t);
}

.radio-item.selected .radio-dot {
  border-color: var(--accent);
  background: var(--accent);
}

/* ═════════════════════════════════════════════════════
   SUBMIT SECTION
   ═════════════════════════════════════════════════════ */
.submit-section {
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.submit-section p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 2;
}

.submit-section .fn {
  font-family: var(--font-display);
  color: var(--accent-dim);
}

.submit-btn {
  display: inline-block;
  padding: 14px 56px;
  background: var(--accent);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background var(--t);
}

.submit-btn:hover { background: #ddd; }
.submit-btn:disabled { background: #222; color: #555; cursor: not-allowed; }

.submit-btn .spinner {
  display: none;
  width: 10px; height: 10px;
  border: 1px solid var(--black);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.submit-btn.loading .spinner { display: inline-block; }

/* ═════════════════════════════════════════════════════
   PROGRESS BAR
   ═════════════════════════════════════════════════════ */
.progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(6px);
  padding: 10px 28px;
  display: none;
  border-bottom: 1px solid var(--line);
}

.progress-bar-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ═════════════════════════════════════════════════════
   TOAST
   ═════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #111;
  border: 1px solid var(--line);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 360px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  pointer-events: auto;
  animation: slideIn 0.25s ease forwards;
}

.toast-success { border-left: 2px solid #0f0; }
.toast-error   { border-left: 2px solid #f44; }
.toast-warning { border-left: 2px solid #fa0; }
.toast-info    { border-left: 2px solid #0af; }

.toast-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.toast-msg  { color: var(--text-sub); }

/* ═════════════════════════════════════════════════════
   SUCCESS PAGE
   ═════════════════════════════════════════════════════ */
#success-page {
  display: none;
  text-align: center;
  padding: 100px 24px;
}

.success-icon {
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: var(--accent);
  margin-bottom: 28px;
  user-select: none;
}

.success-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.success-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 2;
  color: var(--text-sub);
  max-width: 480px;
  margin: 0 auto 40px;
}

.success-sub .fn {
  font-family: var(--font-display);
  color: var(--accent-dim);
}

.success-sub strong {
  font-weight: 600;
  color: var(--accent);
}

.success-back {
  display: inline-block;
  padding: 12px 36px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}

.success-back:hover { border-color: var(--accent); color: var(--accent); }

/* ═════════════════════════════════════════════════════
   FOOTER
   ═════════════════════════════════════════════════════ */
.site-footer {
  padding: 36px 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.35s ease forwards; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 60px 20px 36px; }
  .hero-title { font-size: 2rem; }
  .q-section { padding: 28px 0; }
  .submit-section { padding: 32px 0; }
  .submit-btn { padding: 12px 36px; }
  .container { padding: 0 20px; }
}
