/**
 * CURSING — Dark Academy Design System
 * CSS Global Dark Mode Premium
 */

/* ==============================================
   IMPORTS E FONTES
   ============================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

/* ==============================================
   RESET E VARIÁVEIS CSS
   ============================================== */
:root {
    /* Backgrounds dark */
    --bg-void:        #000000;
    --bg-base:        #050505;
    --bg-surface:     #0a0a0a;
    --bg-elevated:    #121212;
    --bg-card:        rgba(15, 15, 15, 0.85);
    --bg-card-hover:  rgba(25, 25, 25, 0.95);

    /* Cores Primárias */
    --primary:        #f43f5e;
    --primary-dark:   #e11d48;
    --primary-light:  #fb7185;
    --primary-glow:   rgba(244, 63, 94, 0.35);
    --accent:         #7c3aed;
    --accent-light:   #a78bfa;
    --accent-glow:    rgba(124, 58, 237, 0.3);
    --secondary:      #a78bfa;

    /* Gradientes */
    --gradient-primary:   linear-gradient(135deg, #f43f5e 0%, #7c3aed 100%);
    --gradient-accent:    linear-gradient(135deg, #7c3aed 0%, #f43f5e 100%);
    --gradient-neon:      linear-gradient(to right, #fb7185 0%, #a78bfa 100%);
    --gradient-warm:      linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --gradient-success:   linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-gold:      linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-bg:        linear-gradient(135deg, #050505 0%, #0a0a0a 50%, #050505 100%);

    /* Cores de Suporte */
    --success:        #10b981;
    --success-glow:   rgba(16, 185, 129, 0.3);
    --warning:        #f59e0b;
    --warning-glow:   rgba(245, 158, 11, 0.3);
    --error:          #ef4444;
    --error-glow:     rgba(239, 68, 68, 0.3);
    --info:           #3b82f6;

    /* Texto */
    --text-primary:   #ffffff;
    --text-secondary: #f1f5f9;
    --text-muted:     #e2e8f0;
    --text-disabled:  #cbd5e1;

    /* Bordas & Glass */
    --border:         rgba(244, 63, 94, 0.15);
    --border-hover:   rgba(244, 63, 94, 0.4);
    --border-subtle:  rgba(124, 58, 237, 0.12);
    --glass-bg:       rgba(10, 10, 10, 0.75);
    --glass-border:   rgba(244, 63, 94, 0.2);

    /* Tons de Cinza (dark) */
    --gray-50:        #1e2535;
    --gray-100:       #1a2235;
    --gray-200:       #1e293b;
    --gray-300:       #334155;
    --gray-400:       #475569;
    --gray-500:       #64748b;
    --gray-600:       #94a3b8;
    --gray-700:       #cbd5e1;
    --gray-800:       #e2e8f0;
    --gray-900:       #f1f5f9;

    /* BG aliases para compat */
    --bg-primary:     var(--bg-surface);
    --bg-secondary:   var(--bg-base);

    /* Sombras */
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow:         0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md:      0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg:      0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-xl:      0 24px 64px rgba(0, 0, 0, 0.7);
    --shadow-2xl:     0 32px 80px rgba(0, 0, 0, 0.8);
    --shadow-neon:    0 0 20px var(--primary-glow), 0 0 60px rgba(244,63,94,0.15);
    --shadow-cyan:    0 0 20px var(--accent-glow), 0 0 60px rgba(124,58,237,0.1);

    /* Bordas arredondadas */
    --radius-sm:      6px;
    --radius:         10px;
    --radius-md:      14px;
    --radius-lg:      18px;
    --radius-xl:      24px;
    --radius-2xl:     32px;
    --radius-full:    9999px;

    /* Transições */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition:      300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-surface);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
}

/* ==============================================
   TIPOGRAFIA
   ============================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-light);
}

/* ==============================================
   BOTÕES
   ============================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

/* Shimmer effect */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 0 0 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-cyan);
    color: white;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--success-glow);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--error-glow);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-neon);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 17px;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==============================================
   CARDS
   ============================================== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px var(--border-hover);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.card-solid {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}

.card-premium {
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.12) 0%,
        rgba(139, 92, 246, 0.08) 50%,
        rgba(6, 182, 212, 0.12) 100%
    );
    border: 1px solid rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.card-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99,102,241,0.06) 0%, transparent 70%);
    animation: rotateSlow 20s linear infinite;
    pointer-events: none;
}

.card-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==============================================
   FORMULÁRIOS
   ============================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 110px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==============================================
   BADGES E TAGS
   ============================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-gray {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(6, 182, 212, 0.35);
}

/* ==============================================
   ALERTS
   ============================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 3px solid;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #fcd34d;
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ==============================================
   TABELAS
   ============================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead tr {
    border-bottom: 1px solid var(--border-subtle);
}

.table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
}

.table td {
    padding: 14px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

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

/* ==============================================
   UTILITÁRIOS
   ============================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm { max-width: 800px; }
.container-xs { max-width: 540px; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

.text-gradient {
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warm {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-success { color: #34d399; }
.text-error   { color: #f87171; }
.text-warning { color: #fbbf24; }
.text-accent  { color: var(--accent-light); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.gap-1           { gap: 8px; }
.gap-2           { gap: 16px; }
.gap-3           { gap: 24px; }
.gap-4           { gap: 32px; }
.flex-1          { flex: 1; }

.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Glow text */
.glow-text {
    text-shadow: 0 0 20px var(--primary-glow), 0 0 60px rgba(99,102,241,0.2);
}

/* ==============================================
   DIVISORES
   ============================================== */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-subtle);
}

.divider span {
    background: var(--bg-surface);
    padding: 0 16px;
    position: relative;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==============================================
   ANIMAÇÕES
   ============================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

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

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px var(--primary-glow); }
    50%       { box-shadow: 0 0 30px var(--primary-glow), 0 0 60px rgba(99,102,241,0.2); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes orbMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(40px, -30px) scale(1.1); }
    66%       { transform: translate(-30px, 20px) scale(0.9); }
}

.fade-in     { animation: fadeIn var(--transition); }
.fade-in-up  { animation: fadeInUp 0.5s ease-out forwards; }
.scale-in    { animation: scaleIn 0.4s var(--transition-bounce) forwards; }

/* Stagger */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ==============================================
   SPINNER DE LOADING
   ============================================== */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.spinner-accent {
    border-top-color: var(--accent);
}

/* ==============================================
   ORBS DE FUNDO (decorativos)
   ============================================== */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: orbMove 18s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -150px;
    left: -100px;
    animation-duration: 22s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    bottom: -100px;
    right: -80px;
    animation-duration: 18s;
    animation-delay: -8s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 26s;
    animation-delay: -14s;
}

/* ==============================================
   STAT CARD ESPECIAL
   ============================================== */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at top right, rgba(99,102,241,0.1), transparent 70%);
}

.stat-card:hover {
    border-color: rgba(99,102,241,0.4);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(99,102,241,0.2);
    transform: translateY(-3px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}

.stat-content .stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-content .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.4rem; }

    .btn { padding: 11px 20px; font-size: 14px; }
    .btn-lg { padding: 14px 28px; font-size: 16px; }
    .card { padding: 18px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .stat-card { padding: 16px; gap: 14px; }
    .stat-content .stat-value { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 0 16px; }
}
