/* ============================================================
   RIFA — Tema Moderno (Site Público)
   ============================================================ */

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

:root {
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --success: #22c55e;
    --whatsapp: #25d366;
    --instagram: #e1306c;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 12px 40px var(--accent-glow);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Dark (padrão) */
    --bg-body: #0a0a0f;
    --bg-surface: #13131a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --bg-elevated: #252532;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --navbar-bg: rgba(10, 10, 15, 0.85);
}

body.modern-theme {
    font-family: var(--font);
    font-size: 16px;
    background: var(--bg-body) !important;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ---- Navbar ---- */
.modern-theme .navbar-modern {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.modern-theme .navbar-modern .nav-icon-btn {
    color: var(--text-secondary) !important;
    font-size: 1.75rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.modern-theme .navbar-modern .nav-icon-btn:hover {
    color: var(--text-primary) !important;
    background: var(--bg-elevated);
}

.modern-theme .navbar-modern .nav-badge-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.modern-theme .navbar-modern .nav-badge-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
    color: #fff !important;
}

/* ---- Mobile menu ---- */
.modern-theme .modal-mobile-menu .modal-content {
    background: var(--bg-body) !important;
    border: none;
}

.modern-theme .modal-mobile-menu .modal-body {
    background: var(--bg-body) !important;
}

.modern-theme .modal-mobile-menu .nav-vertical ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-theme .modal-mobile-menu .nav-vertical li {
    margin-bottom: 0.25rem;
}

.modern-theme .modal-mobile-menu .nav-vertical a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary) !important;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.modern-theme .modal-mobile-menu .nav-vertical a:hover {
    background: var(--bg-elevated);
}

.modern-theme .modal-mobile-menu .btn-entrar {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    font-weight: 600;
    padding: 0.85rem;
    margin-top: 1rem;
}

/* ---- App container ---- */
.modern-theme .app-main {
    width: 100%;
    max-width: 600px;
    margin: 56px auto 50px;
    padding: 0 8px;
    border-radius: 20px;
    position: relative;
    min-height: calc(100vh - 106px);
}

/* Força largura total — antes .rifas era absolute e ignorava col-md-6 */
.modern-theme .app-main > .row > [class*="col-"] {
    width: 100% !important;
    max-width: 600px !important;
    flex: 0 0 100% !important;
    padding-left: 6px;
    padding-right: 6px;
}

.modern-theme .rifas {
    background: var(--bg-surface);
    position: relative;
    min-height: auto;
    border-radius: 20px;
    padding: 8px 10px 2rem;
    width: 100%;
}

/* ---- Section titles ---- */
.modern-theme .app-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 1.25rem 0 0.75rem;
}

.modern-theme .app-title h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.modern-theme .app-title .app-title-desc {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Featured raffle card ---- */
.modern-theme .card-rifa-destaque {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.modern-theme a:hover .card-rifa-destaque {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

.modern-theme .card-rifa-destaque .img-rifa-destaque {
    position: relative;
    overflow: hidden;
}

.modern-theme .card-rifa-destaque .img-rifa-destaque::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg-card));
}

.modern-theme .card-rifa-destaque .img-rifa-destaque img {
    width: 100%;
    height: 290px;
    object-fit: cover;
    border-radius: 0;
}

.modern-theme .title-rifa-destaque {
    padding: 12px 14px 14px;
}

.modern-theme .title-rifa-destaque h1 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.35;
}

.modern-theme .title-rifa-destaque p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.modern-theme .data-sorteio {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    background: var(--bg-elevated);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

/* ---- Normal raffle card ---- */
.modern-theme .card-rifa {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: var(--transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.modern-theme a:hover .card-rifa {
    transform: translateX(4px);
    border-color: rgba(99, 102, 241, 0.25);
    background: var(--bg-card-hover);
}

.modern-theme .card-rifa img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.modern-theme .card-rifa .title-rifa {
    margin-left: 0;
    flex: 1;
    min-width: 0;
}

/* ---- Contact card ---- */
.modern-theme .duvida {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-top: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.modern-theme .duvida:hover {
    border-color: var(--whatsapp);
    background: var(--bg-card-hover);
}

.modern-theme .icone-duvidas {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.modern-theme .text-duvidas h6 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.modern-theme .text-duvidas p {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
}

/* ---- Winners ---- */
.modern-theme .ganhador {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.modern-theme .ganhador:hover {
    border-color: var(--success);
    transform: translateY(-2px);
}

.modern-theme .ganhador-foto img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--success);
    object-fit: cover;
}

.modern-theme .ganhador-desc {
    flex: 1;
    min-width: 0;
}

.modern-theme .ganhador-desc h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.modern-theme .ganhador-desc p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.modern-theme .ganhador-rifa img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* ---- FAQ accordion ---- */
.modern-theme .perguntas-frequentes .accordion .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.modern-theme .perguntas-frequentes .card-header {
    background: transparent;
    border: none;
    padding: 0;
}

.modern-theme .perguntas-frequentes .card-header button {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.1rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
}

.modern-theme .perguntas-frequentes .card-body {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 0 1.1rem 1rem;
    background: transparent;
    border: none;
}

/* ---- Modals ---- */
.modern-theme .modal-modern .modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modern-theme .modal-modern .modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
}

.modern-theme .modal-modern .modal-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.modern-theme .modal-modern .modal-body {
    background: var(--bg-surface);
    padding: 1.25rem;
}

.modern-theme .modal-modern .btn-close-custom {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modern-theme .modal-modern .form-control {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.modern-theme .modal-modern .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.modern-theme .btn-modern-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modern-theme .btn-modern-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
    color: #fff;
}

/* ---- Floating buttons ---- */
.modern-theme .fab-group {
    position: fixed;
    right: 16px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
}

.modern-theme .fab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.modern-theme .fab-btn:hover {
    transform: scale(1.05);
    color: #fff;
    text-decoration: none;
}

.modern-theme .fab-btn.whatsapp {
    background: var(--whatsapp);
}

.modern-theme .fab-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* ---- Loading overlay ---- */
.modern-theme #loadingSystem {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(4px);
}

.modern-theme #loadingSystem::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Login page ---- */
.modern-theme .login-modern {
    max-width: 400px;
    margin: 100px auto 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.modern-theme .login-modern .login-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.modern-theme .login-modern .login-title h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.modern-theme .login-modern .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.modern-theme .login-modern .form-group {
    margin-bottom: 1.25rem;
}

.modern-theme .login-modern label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.modern-theme .login-modern .form-control {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.modern-theme .login-modern .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modern-theme .login-modern .btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    transition: var(--transition);
}

.modern-theme .login-modern .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
    color: #fff;
}

/* ---- Dark theme overrides (config->tema = dark) ---- */
.modern-theme .rifas.dark,
.modern-theme .rifa-dark {
    background: #383838;
}

.modern-theme .card-rifa-destaque.dark,
.modern-theme .card-rifa.dark,
.modern-theme .ganhador.dark,
.modern-theme .duvida.dark {
    background: var(--bg-card);
}

.modern-theme .app-title.dark h1,
.modern-theme .title-rifa-destaque.dark h1,
.modern-theme .ganhador-desc.dark h3,
.modern-theme .text-duvidas.dark h6 {
    color: var(--text-primary);
}

.modern-theme .title-rifa-destaque.dark p,
.modern-theme .app-title-desc.dark,
.modern-theme .data-sorteio.dark,
.modern-theme .ganhador-desc.dark p {
    color: var(--text-secondary) !important;
}

/* ---- Footer ---- */
.modern-theme .footer {
    background: var(--bg-surface) !important;
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.modern-theme .footer span,
.modern-theme .footer a span {
    color: var(--text-muted) !important;
    font-size: 0.75rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .modern-theme .app-main {
        margin-top: 56px;
        position: relative;
        z-index: 1;
        padding: 0 4px;
    }

    .modern-theme .meus-numeros {
        margin-left: 0 !important;
    }
}

@media (min-width: 769px) {
    .modern-theme .app-main {
        margin-top: 72px;
    }
}

/* ---- Scrollbar (checkout / cotas) ---- */
.modern-theme #div-cotas::-webkit-scrollbar {
    width: 8px;
}

.modern-theme #div-cotas::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 999px;
}

.modern-theme #div-cotas::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 999px;
}
