/* ============================================================
   CreatorBox Design System
   Palette: midnight-violet base, aurora gradient (violet → magenta → amber)
   Type: Sora (display) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color tokens — warm, light, colorful base with vibrant gradient accents */
  --ink:        #FFF8F3;   /* warm off-white base */
  --ink-soft:   #FAF5FF;   /* subtle lavender tint, for rows/panels needing contrast from pure-white cards */
  --surface:    #FFFFFF;
  --surface-2:  #FDF2FF;
  --border:     rgba(124,58,237,0.12);
  --text:       #241B3D;
  --text-dim:   #6E6486;

  --violet:     #7C3AED;
  --violet-2:   #A855F7;
  --magenta:    #EC4899;
  --amber:      #F59E0B;
  --teal:       #0D9488;
  --red:        #E11D48;

  --gradient-aurora: linear-gradient(120deg, var(--violet) 0%, var(--magenta) 55%, var(--amber) 100%);
  --gradient-cta:    linear-gradient(90deg, var(--violet-2) 0%, var(--magenta) 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-glow: 0 8px 32px rgba(124,58,237,0.18);
  --shadow-card: 0 2px 14px rgba(36,27,61,0.06);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}

a { color: var(--violet-2); text-decoration: none; }
a:hover { color: var(--magenta); }

p { color: var(--text-dim); margin: 0 0 1em; }

::selection { background: var(--magenta); color: white; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Layout shells ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

.auth-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #6D28D9 0%, #C026D3 55%, #F59E0B 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}
.auth-visual, .auth-visual p, .auth-visual .brand-mark { color: #fff; }
.auth-visual::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 55%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(-4%, -2%) scale(1); }
  100% { transform: translate(4%, 4%) scale(1.08); }
}

.brand-mark {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-mark span { background: var(--gradient-aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }

.mock-card {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 380px;
}
.mock-card .mc-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gradient-aurora);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.mock-card .mc-line { height: 10px; border-radius: 6px; background: rgba(255,255,255,0.14); margin-bottom: 8px; }
.mock-card .mc-line.short { width: 55%; }
.mock-card .mc-price { display:inline-block; margin-top:14px; padding: 8px 16px; border-radius: 999px; background: var(--gradient-cta); color: #fff; font-weight:700; font-size:13px; }

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap .eyebrow { color: var(--violet-2); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.auth-form-wrap h1 { font-size: 28px; }
.auth-form-wrap .subtitle { margin-bottom: 28px; }

/* ---------- Form elements ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--violet-2);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.25);
}
.field .hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border: none; cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient-cta); color: #fff; box-shadow: var(--shadow-glow); width: 100%; }
.btn-primary:hover { opacity: .93; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--violet-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }

.divider-text { display:flex; align-items:center; gap:12px; color:var(--text-dim); font-size:13px; margin: 18px 0; }
.divider-text::before, .divider-text::after { content:''; flex:1; height:1px; background: var(--border); }

/* ---------- Alerts / badges ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error   { background: rgba(225,29,72,0.07);   border-color: rgba(225,29,72,0.28);   color: #B91C3C; }
.alert-success { background: rgba(13,148,136,0.08);  border-color: rgba(13,148,136,0.28);  color: #0F766E; }
.alert-info    { background: rgba(124,58,237,0.08);  border-color: rgba(124,58,237,0.28);  color: #6D28D9; }

.badge { display:inline-flex; align-items:center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-active    { background: rgba(13,148,136,0.12);  color: #0F766E; }
.badge-inactive  { background: rgba(110,100,134,0.12); color: var(--text-dim); }
.badge-suspended { background: rgba(225,29,72,0.12);   color: #B91C3C; }
.badge-super     { background: rgba(245,158,11,0.15);  color: #92400E; }
.badge-admin     { background: rgba(124,58,237,0.13);  color: #6D28D9; }
.badge-creator   { background: rgba(236,72,153,0.13);  color: #BE185D; }

.code-inputs { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.code-inputs input {
  width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.code-inputs input:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(168,85,247,0.25); }

/* ---------- Dashboard shell (admin/creator) ---------- */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .app-shell { grid-template-columns: 1fr; } .app-sidebar { display:none; } }

.app-sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.app-sidebar .brand-mark { padding: 8px 10px 22px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: rgba(124,58,237,0.08); color: var(--text); }
.nav-link.active { background: var(--gradient-cta); color: #fff; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); padding: 16px 12px 6px; }

.app-main { padding: 28px 32px; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.app-topbar h1 { font-size: 22px; margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-md);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); border-radius: var(--radius-md); padding: 18px 20px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: rgba(124,58,237,0.035); }

.table-wrap { overflow-x: auto; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(5,3,12,0.7); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 520px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(36,27,61,0.18); border-radius: var(--radius-lg); padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 18px; }
.modal-close { background:none; border:none; color: var(--text-dim); font-size: 20px; cursor:pointer; }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perm-check { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }

.footer-note { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-dim); }

/* Illustrated person-avatar — used wherever a "profile picture" placeholder is needed.
   Deliberately not a photo: no real/stock person is depicted, so there's no licensing
   or false-endorsement risk. Real creators replace this with their own uploaded photo. */
.avatar-illustration {
  border-radius: 50%;
  background: var(--gradient-aurora);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.avatar-illustration svg { width: 55%; height: 55%; }

.avatar-photo {
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(36,27,61,0.18);
}
