/* ============================================================
   OneLink Pro — Design System
   Premium link-in-bio for African creators
   ============================================================ */

/* — Fonts — */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* — Variables — */
:root {
  /* Core palette */
  --bg-primary: #060B16;
  --bg-secondary: #0C1222;
  --bg-card: #111827;
  --bg-card-hover: #1A2235;
  --bg-input: #0F1629;
  --border: #1E293B;
  --border-light: #334155;

  /* Gold system */
  --gold: #C8A96E;
  --gold-light: #E2CC93;
  --gold-dim: #8B7545;
  --gold-glow: rgba(200, 169, 110, 0.15);
  --gold-glow-strong: rgba(200, 169, 110, 0.3);

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #060B16;

  /* Status */
  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --error: #F87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --warning: #FBBF24;
  --info: #60A5FA;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Typography */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 24px rgba(200, 169, 110, 0.2);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* — Reset — */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* — Typography — */
.heading-xl {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.heading-lg {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.heading-md {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.heading-sm {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.text-body { font-size: 1rem; color: var(--text-secondary); line-height: 1.7; }
.text-sm { font-size: 0.875rem; color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; color: var(--text-muted); }
.text-gold { color: var(--gold); }

/* — Buttons — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--gold-light);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: var(--gold-glow);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* — Inputs — */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.input::placeholder { color: var(--text-muted); }

.input-error { border-color: var(--error) !important; }
.error-text { font-size: 0.8rem; color: var(--error); margin-top: 2px; }

/* — Cards — */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}
.card:hover {
  border-color: var(--border-light);
}

.card-glow:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px var(--gold-glow), var(--shadow-md);
}

/* — Layout utilities — */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm { max-width: 480px; }
.container-md { max-width: 640px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* — Badges — */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-gold {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid rgba(200, 169, 110, 0.2);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

/* — Divider — */
.divider {
  height: 1px;
  background: var(--border);
  width: 100%;
}

/* — Toast / Alert — */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  animation: slideIn var(--duration-slow) var(--ease-spring);
  max-width: 360px;
}
.toast-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.toast-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

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

/* — Loading spinner — */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* — Modal — */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn var(--duration-slow) var(--ease-spring);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* — Responsive — */
@media (max-width: 640px) {
  .container { padding: 0 var(--space-md); }
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .hide-desktop { display: none !important; }
}
