/**
 * Roleplay Project — Brand Design System
 * Source of truth: launcher/src/index.css
 * All pages should <link> this file for consistent brand identity.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS (CSS Variables)
   ═══════════════════════════════════════════ */
:root {
    /* Background scale (darkest → lightest) */
    --color-dark-950: #050508;
    --color-dark-900: #0a0a0f;
    --color-dark-850: #0d0d14;
    --color-dark-800: #111118;
    --color-dark-700: #1a1a24;
    --color-dark-600: #22222e;
    --color-dark-500: #2e2e3c;
    --color-dark-400: #3e3e4e;
    --color-dark-300: #6b7280;

    /* Accent */
    --color-accent: #3b82f6;
    --color-accent-hover: #60a5fa;
    --color-accent-glow: #3b82f640;
    --color-accent-dim: #3b82f615;

    /* Status */
    --color-success: #22c55e;
    --color-error: #f87171;
    --color-warning: #fbbf24;

    /* Text */
    --text-primary: #e5e5e5;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.3);
    --text-dim: rgba(255, 255, 255, 0.2);

    /* Surfaces */
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.07);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --divider: rgba(255, 255, 255, 0.05);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --nav-height: 64px;
    --container-max: 1200px;
}

/* ═══════════════════════════════════════════
   BASE RESET & DEFAULTS
   ═══════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-dark-900);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--color-accent-hover);
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* ═══════════════════════════════════════════
   GLASS CARDS
   ═══════════════════════════════════════════ */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.glass-card:hover {
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 28px;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    color: #fff;
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.btn-primary:disabled {
    background: var(--color-dark-600);
    color: var(--text-dim);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════
   FORM INPUTS
   ═══════════════════════════════════════════ */
.input-field {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input-field::placeholder {
    color: var(--text-dim);
}
.input-field:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════ */
.section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.heading-xl {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
}

.heading-lg {
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.heading-md {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.heading-sm {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   BACKGROUNDS & PATTERNS
   ═══════════════════════════════════════════ */
.bg-dots {
    background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 28px 28px;
}

.bg-950 { background: var(--color-dark-950); }
.bg-900 { background: var(--color-dark-900); }
.bg-850 { background: var(--color-dark-850); }
.bg-800 { background: var(--color-dark-800); }

/* ═══════════════════════════════════════════
   PAGE HERO / HEADER SECTIONS
   ═══════════════════════════════════════════ */
.page-hero {
    position: relative;
    padding: 100px 40px 60px;
    text-align: center;
    overflow: hidden;
    background: var(--color-dark-950);
}

.page-hero .section-label {
    margin-bottom: 16px;
}

.page-hero .heading-xl {
    margin-bottom: 20px;
}

.page-hero .hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--color-dark-900));
    pointer-events: none;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 80px 20px 48px;
    }
}

/* ═══════════════════════════════════════════
   PAGE CONTENT SECTIONS
   ═══════════════════════════════════════════ */
.page-section {
    padding: 80px 40px;
}

.page-section:nth-child(even) {
    background: var(--color-dark-850);
}

@media (max-width: 768px) {
    .page-section {
        padding: 48px 20px;
    }
}

/* ═══════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-accent {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.badge-error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(248, 113, 113, 0.15);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

/* ═══════════════════════════════════════════
   DIVIDERS
   ═══════════════════════════════════════════ */
.divider {
    border: none;
    border-top: 1px solid var(--divider);
    margin: 32px 0;
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.brand-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.brand-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
}

.brand-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--divider);
}

.brand-table tr:last-child td {
    border-bottom: none;
}

.brand-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ═══════════════════════════════════════════
   GTA-STYLE LOADING SCREEN
   ═══════════════════════════════════════════ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(ellipse at center, #0a0a0f 0%, #050508 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Hide any page-specific inner elements — logo+spinner come from pseudo-elements */
.page-loader > * {
    display: none !important;
}

/* Logo image via ::before */
.page-loader::before {
    content: '';
    display: block;
    width: 240px;
    height: 240px;
    background: url('/images/logo.png') center / contain no-repeat;
    filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.04));
    opacity: 0;
    animation: gta-logo-in 0.8s ease 0.15s forwards;
}

/* GTA circular spinner via ::after */
.page-loader::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    border: 2.5px solid rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    animation: gta-spin 0.65s linear infinite, gta-fade-in 0.3s ease 0.6s both;
}

@keyframes gta-spin {
    to { transform: rotate(360deg); }
}

@keyframes gta-logo-in {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes gta-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--color-accent-glow), 0 0 50px rgba(59, 130, 246, 0.12); }
    50% { box-shadow: 0 0 35px var(--color-accent-glow), 0 0 70px rgba(59, 130, 246, 0.18); }
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes loader-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-100%); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-slideUp { animation: slideUp 0.5s ease; }
.animate-glow { animation: pulse-glow 3s ease-in-out infinite; }
.animate-pulse { animation: status-pulse 2s ease-in-out infinite; }

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.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-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-28 { padding: 28px; }
.p-32 { padding: 32px; }

.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-600 { max-width: 600px; }
.max-w-800 { max-width: 800px; }
.max-w-900 { max-width: 900px; }

/* Focus reset for inputs/buttons */
input:focus, button:focus-visible, select:focus, textarea:focus {
    outline: none;
}
