/* ============================================
   webTHI QR Code Pro - Premium Dark Design System
   ============================================ */

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

/* === CSS Variables === */
:root {
    /* Brand Colors */
    --primary-color: #FF7A00;
    --primary-hover: #FF8F26;
    --primary-active: #E65C00;
    --primary-glow: rgba(255, 122, 0, 0.4);
    --primary-subtle: rgba(255, 122, 0, 0.1);

    /* Dark Mode Palette - Deep & Professional */
    --bg-base: #050505; /* Deepest black */
    --bg-surface: #111111; /* Card background */
    --bg-surface-hover: #161616;
    --bg-elevated: #1a1a1a; /* Modals, dropdowns */
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(255, 122, 0, 0.5);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-tertiary: #71717A;

    /* Semantic */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
    --shadow-brand: 0 8px 25px var(--primary-glow);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p { color: var(--text-secondary); }

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

/* =============================================
   GLASSMORPHISM NAVBAR
   ============================================= */
.navbar {
    background: rgba(5, 5, 5, 0.75) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary) !important;
    font-size: 1.3rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.03);
}

/* Mobile Menu Overlays (Floating Dropdown Panel) */
@media (max-width: 991px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        background: rgba(17, 17, 17, 0.98) !important;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1.5rem;
        margin-top: 0.5rem;
        z-index: 1050;
        box-shadow: var(--shadow-lg);
    }
    .navbar-nav {
        align-items: stretch !important;
        text-align: center;
    }
    .nav-link {
        padding: 0.8rem !important;
        font-size: 1.1rem;
        border-radius: var(--radius-sm);
        display: block !important;
        min-height: 44px;
    }
    .btn {
        min-height: 44px; /* Touch target minimum on mobile */
    }
}

/* =============================================
   PREMIUM BUTTONS
   ============================================= */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.75rem;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-active) 100%);
    color: #FFF !important;
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

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

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-hover) !important;
    color: var(--primary-hover) !important;
}

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

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.btn-dark {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}
.btn-dark:hover {
    background: #222;
    border-color: rgba(255,255,255,0.1);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}
.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* =============================================
   CARDS & SURFACES
   ============================================= */
.card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md);
}

.card-body { color: var(--text-secondary); }
.card-title { color: var(--text-primary) !important; }
.card-text { color: var(--text-secondary) !important; }

/* Interactive Cards (Pricing, Features) */
.feature-card, .pricing-card {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: visible;
}

.feature-card::before, .pricing-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,122,0,0.5), transparent);
    opacity: 0;
    transition: var(--transition);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.feature-card:hover, .pricing-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    background: var(--bg-surface-hover);
}

.feature-card:hover::before, .pricing-card:hover::before {
    opacity: 1;
}

/* =============================================
   MODERN FORM ELEMENTS
   ============================================= */
.form-control, .form-select {
    background-color: var(--bg-base) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-elevated) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px var(--primary-subtle) !important;
}

.form-label {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-tertiary) !important;
}

/* =============================================
   TABLES
   ============================================= */
.table {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.table > thead th {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table > tbody td {
    border-color: var(--border-color) !important;
    padding: 1rem;
    vertical-align: middle;
    background: transparent !important;
}

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

.table > tbody tr:hover td {
    background: rgba(255,255,255,0.02) !important;
}

/* =============================================
   BADGES & ALERTS
   ============================================= */
.badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.bg-success { background: rgba(16, 185, 129, 0.15) !important; color: var(--success) !important; border: 1px solid rgba(16, 185, 129, 0.2); }
.bg-warning { background: rgba(245, 158, 11, 0.15) !important; color: var(--warning) !important; border: 1px solid rgba(245, 158, 11, 0.2); }
.bg-danger  { background: rgba(239, 68, 68, 0.15) !important;  color: var(--error) !important;   border: 1px solid rgba(239, 68, 68, 0.2); }
.bg-primary { background: var(--primary-subtle) !important;    color: var(--primary-color) !important; border: 1px solid rgba(255, 122, 0, 0.2); }
.bg-info    { background: rgba(59, 130, 246, 0.15) !important; color: var(--info) !important;    border: 1px solid rgba(59, 130, 246, 0.2); }

.alert {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    padding: 1rem 1.25rem;
}

.alert-success { background: rgba(16, 185, 129, 0.1) !important; color: var(--success) !important; border-color: rgba(16, 185, 129, 0.2) !important; }
.alert-danger  { background: rgba(239, 68, 68, 0.1) !important;  color: var(--error) !important;   border-color: rgba(239, 68, 68, 0.2) !important; }

/* =============================================
   HERO SECTION (Apple/Vercel Style)
   ============================================= */
.hero {
    position: relative;
    padding: 7rem 0 5rem;
    text-align: center;
    overflow: hidden;
}

/* Glow effects in background */
.hero::before {
    content: '';
    position: absolute;
    top: -30%; left: 50%;
    transform: translateX(-50%);
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(255,122,0,0.15) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    position: relative;
    z-index: 1;
}

/* =============================================
   ACCORDION (FAQ)
   ============================================= */
.accordion-item {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
}

.accordion-button {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1.5rem 1rem !important;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color) !important;
}

.accordion-button::after {
    filter: invert(1);
    transition: var(--transition);
}
.accordion-button:not(.collapsed)::after {
    filter: invert(50%) sepia(90%) saturate(1500%) hue-rotate(0deg) brightness(100%);
}

.accordion-body {
    padding: 0 1rem 1.5rem 1rem !important;
    color: var(--text-secondary);
}

/* =============================================
   UTILS & OVERRIDES
   ============================================= */
.bg-light, .bg-white { background-color: var(--bg-surface) !important; }
.bg-dark { background-color: var(--bg-base) !important; }

.text-primary { color: var(--primary-color) !important; }
.text-muted   { color: var(--text-tertiary) !important; }
.text-white   { color: var(--text-primary) !important; }

.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

hr { border-color: var(--border-color) !important; opacity: 1; }

.icon-box {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255,122,0,0.1) 0%, transparent 100%);
    border: 1px solid rgba(255,122,0,0.2);
    color: var(--primary-color);
    font-size: 1.75rem;
}

/* Dashboard Specifics */
.dashboard-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, var(--primary-subtle) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.dashboard-stat-card:hover {
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* =============================================
   EXTREME RESPONSIVENESS (MOBILE FIRST & CLAMP)
   ============================================= */

/* 1. Global Layout & Overflow Protection */
/* We use overflow-x: clip so that position: sticky (sticky-top menu) keeps working perfectly */
html, body {
    overflow-x: clip;
    width: 100%;
    min-height: 100vh;
}

/* 2. Fluid Typography (Clamp) */
/* Calculates smoothly from 320px to 1920px screens */
html { font-size: clamp(14px, 1vw + 10px, 16px); }

h1, .h1 { font-size: clamp(2rem, 5vw + 1rem, 3.5rem) !important; }
h2, .h2 { font-size: clamp(1.75rem, 4vw + 1rem, 2.75rem) !important; }
h3, .h3 { font-size: clamp(1.5rem, 3vw + 0.8rem, 2.25rem) !important; }
h4, .h4 { font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.75rem) !important; }
h5, .h5 { font-size: clamp(1.1rem, 2vw + 0.5rem, 1.25rem) !important; }
h6, .h6 { font-size: clamp(1rem, 1.5vw + 0.5rem, 1.1rem) !important; }
.lead { font-size: clamp(1.1rem, 2vw + 0.5rem, 1.25rem) !important; }
p, li { font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.05rem); }

/* 3. Touch Targets (Accessibility & Mobile) */
/* Apply globally only to inputs. Buttons and Nav-links are styled for mobile inside the media query to preserve desktop design. */
.form-control, .form-select, .accordion-button {
    min-height: 44px; /* Apple/Google Touch Target minimum */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.form-control, .form-select {
    min-width: 100%; /* Avoids forms breaking boundaries */
}
input[type="checkbox"], input[type="radio"] {
    min-width: 24px; min-height: 24px;
}

/* 4. Responsive Images & Media */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* 5. Responsive Tables (Cards on Mobile) */
@media (max-width: 767px) {
    .table-responsive {
        border: 0;
    }
    .table-responsive table {
        display: block;
        width: 100%;
    }
    .table-responsive thead {
        display: none; /* Esconde cabeçalho no celular */
    }
    .table-responsive tbody {
        display: block;
        width: 100%;
    }
    .table-responsive tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-surface);
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        padding: 1rem;
    }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none !important;
        padding: 0.5rem 0 !important;
        background: transparent !important;
        text-align: right;
    }
    .table-responsive td::before {
        content: attr(data-label); /* Requires data-label in HTML, gracefully degrades if missing */
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        font-size: 0.8rem;
        text-align: left;
        margin-right: 1rem;
    }
    .table-responsive td:last-child {
        justify-content: flex-end;
        gap: 0.5rem;
    }
}

/* 6. Dynamic Grids for Cards and Widgets (CSS Grid) */
/* This overrides flexbox when we want absolute responsive wrapping without breaking */
.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(260px, 30vw, 320px), 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 575px) {
    /* Modais e formulários full width no mobile */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .auth-card {
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
    }
    .hero {
        padding: 4rem 0 2rem;
    }
}

@media (min-width: 1920px) {
    /* Ultra Wide Optimizations */
    .auth-card {
        padding: 3rem !important;
    }
}
