/* ────────────────────────────────────────────────────────────────────────────
   MDCreator — Shared Design System
   style.css
   ──────────────────────────────────────────────────────────────────────────── */

/* ── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --bg:           #07080d;
  --surface:      #0f1117;
  --surface2:     #171b26;
  --surface3:     #1e2333;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --accent:       #6366f1;
  --accent2:      #8b5cf6;
  --accent-light: #a5b4fc;
  --accent-glow:  rgba(99,102,241,0.3);
  --green:        #22c55e;
  --red:          #ef4444;
  --yellow:       #f59e0b;
  --text:         #e2e4ef;
  --text-muted:   #6b7280;
  --text-faint:   #374151;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    5px;
  --font:         'Inter', system-ui, sans-serif;
  --mono:         'JetBrains Mono', monospace;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.6);
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── BACKGROUND GLOW ──────────────────────────────────────────────────────── */
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% -5%,  rgba(99,102,241,0.11) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 110%, rgba(139,92,246,0.09) 0%, transparent 60%);
}

/* ── LAYOUT ────────────────────────────────────────────────────────────────── */
.container      { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm   { max-width: 700px;  margin: 0 auto; padding: 0 24px; }
.container-xs   { max-width: 480px;  margin: 0 auto; padding: 0 24px; }
.page-wrap      { position: relative; z-index: 1; padding-top: 80px; }

/* ── NAVIGATION ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(7,8,13,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e2e4ef, #a5b4fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 28px; flex: 1; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-auth { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer; flex-shrink: 0;
  position: relative;
}
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 210px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none; flex-direction: column;
  z-index: 200;
}
.user-menu.open { display: flex; }
.user-menu-info { padding: 14px 16px; }
.user-menu-name  { display: block; font-weight: 600; font-size: 0.9rem; }
.user-menu-email { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.user-menu-divider { height: 1px; background: var(--border); }
.user-menu-item {
  padding: 10px 16px; font-size: 0.88rem; color: var(--text);
  display: block; transition: background 0.15s; border: none;
  background: none; width: 100%; text-align: left;
}
.user-menu-item:hover { background: rgba(255,255,255,0.05); }
.user-menu-logout { color: var(--red) !important; }

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px;
  border-radius: var(--radius-sm); border: none;
  font-family: var(--font); font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 8px 28px rgba(99,102,241,0.5);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-lg { padding: 15px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 0.83rem; }
.btn-full { width: 100%; }
.btn-google {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  gap: 10px;
}
.btn-google:hover { border-color: var(--border-hover); background: var(--surface3); }

/* ── FORM ────────────────────────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label  { font-size: 0.87rem; font-weight: 500; color: var(--text-muted); }
.form-input, .form-textarea {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 0.95rem; padding: 12px 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-hint  { font-size: 0.8rem; color: var(--text-muted); }
.form-error { font-size: 0.83rem; color: var(--red); }
.divider-or {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.82rem; margin: 20px 0;
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.card:hover { border-color: var(--border-hover); }

/* ── BADGE / PILL ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-indigo { background: rgba(99,102,241,0.15); color: var(--accent-light); }
.badge-green  { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }

/* ── SECTION WRAPPER ──────────────────────────────────────────────────────── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 12px;
}
.section-sub {
  font-size: 1.05rem; color: var(--text-muted); max-width: 540px;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .nav-logo { font-size: 1.2rem; margin-bottom: 10px; display: block; }
.footer-brand p { font-size: 0.88rem; color: var(--text-muted); max-width: 240px; line-height: 1.7; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px; }
.footer-col a  { display: block; font-size: 0.88rem; color: var(--text-muted);
  margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1100px; margin: 32px auto 0; padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.83rem; color: var(--text-muted);
}
.footer-trust {
  display: flex; align-items: center; gap: 20px;
  margin-top: 12px; opacity: 0.7; filter: grayscale(1);
  transition: opacity 0.2s, filter 0.2s;
}
.footer-trust:hover { opacity: 1; filter: grayscale(0); }
.stripe-badge { height: 24px; }

/* ── SPINNER ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ALERT BANNER ────────────────────────────────────────────────────────── */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 0.88rem; margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #86efac; }
.alert-info   { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); color: var(--accent-light); }
.alert { display: none; }
.alert.show { display: flex; }

/* ── ANIMATIONS  ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.anim-up   { animation: fadeUp  0.5s ease both; }
.anim-in   { animation: fadeIn  0.4s ease both; }
.delay-1   { animation-delay: 0.1s; }
.delay-2   { animation-delay: 0.2s; }
.delay-3   { animation-delay: 0.3s; }

/* ── UTILITIES ───────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .section { padding: 56px 0; }
  .container, .container-sm { padding: 0 16px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
