/* ==========================================================================
   ESTILOS GERAIS E SISTEMA DE DESIGN RESPONSIVO - PORTAL DE DOAÇÕES
   ========================================================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-dark: #0f172a;
    --primary-light: #eff6ff;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --bg-light: #f8fafc;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 20px 35px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -4px rgba(0, 0, 0, 0.05);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: #1e293b;
    background-color: var(--bg-light);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* ==========================================================================
   NAVBAR RESPONSIVA
   ========================================================================== */

.main-navbar {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.main-navbar .navbar-brand {
    font-size: 1.15rem;
    letter-spacing: -0.2px;
}

.main-navbar .nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
    color: #cbd5e1 !important;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link:focus,
.main-navbar .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

.main-navbar .navbar-toggler {
    padding: 0.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.08);
}

.main-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* ==========================================================================
   HEADER COM GRADIENTE
   ========================================================================== */

.bg-gradient-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* ==========================================================================
   TELA INICIAL / PORTÃO (GATE) RESPONSIVA
   ========================================================================== */

.gate-page-body {
    background-color: #0f172a;
}

.gate-hero-container {
    position: relative;
    min-height: calc(100vh - 44px);
    min-height: calc(100dvh - 44px);
    background-image: url('../imagens/FotoCampanha.jpg'), url('../imagens/FotoCampanha.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.75rem;
}

.gate-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 58, 138, 0.82) 50%, rgba(15, 23, 42, 0.94) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gate-card {
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65) !important;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gate-title {
    font-size: clamp(1.6rem, 4vw + 0.5rem, 2.75rem);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
    line-height: 1.25;
}

.gate-subtitle {
    font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    line-height: 1.5;
}

.gate-divider {
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #f59e0b);
    border-radius: 2px;
}

.btn-glow {
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
}

.btn-glow:hover,
.btn-glow:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.65);
}

.btn-glow:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   CARDS DE DOAÇÃO E FORMULÁRIO RESPONSIVOS
   ========================================================================== */

.info-card, .donatario-card, .form-card {
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-light-primary {
    background-color: #eff6ff;
}

.bg-primary-subtle {
    background-color: #dbeafe !important;
}

.bg-success-subtle {
    background-color: #dcfce7 !important;
}

/* Option Box de Valores para Doação */
.value-card-label {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background-color: #ffffff;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 84px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.value-card-label:hover {
    border-color: var(--primary-color);
    background-color: #f8fafc;
    transform: translateY(-2px);
}

.btn-check:checked + .value-card-label {
    border-color: var(--primary-color) !important;
    background-color: #eff6ff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
    transform: translateY(-2px);
}

.btn-check:checked + .value-card-label .small {
    color: var(--primary-color) !important;
    font-weight: 700;
}

.btn-check:focus + .value-card-label {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* Campos de Formulário Otimizados para Toque */
.form-control, .form-select {
    font-size: 1rem;
    min-height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-control-lg {
    min-height: 52px;
    font-size: 1.05rem;
}

.input-group-text {
    border-color: #cbd5e1;
    min-height: 48px;
    border-radius: var(--radius-sm);
}

/* Prevenção de Auto-Zoom no iOS Safari */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Botões com Área de Toque Mínima (44px+) */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.btn-lg {
    min-height: 52px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ==========================================================================
   SWEETALERT2 RESPONSIVO PARA SMARTPHONES
   ========================================================================== */

.swal2-popup {
    border-radius: var(--radius-lg) !important;
    font-family: var(--font-main) !important;
    max-width: 95vw !important;
}

@media (max-width: 576px) {
    .swal2-popup {
        width: 94vw !important;
        padding: 1.25rem 0.85rem !important;
        border-radius: var(--radius-md) !important;
    }
    
    .swal2-title {
        font-size: 1.25rem !important;
        padding: 0.5rem 0.25rem !important;
    }

    .swal2-html-container {
        font-size: 0.875rem !important;
        margin: 0.5rem 0 !important;
        padding: 0 !important;
    }

    .swal2-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 0.5rem !important;
        margin-top: 1rem !important;
    }

    .swal2-actions button {
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        font-size: 1rem !important;
    }

    .swal-pix-group {
        flex-direction: column !important;
    }

    .swal-pix-group input {
        width: 100% !important;
        border-radius: var(--radius-sm) !important;
        margin-bottom: 0.5rem;
    }

    .swal-pix-group button {
        width: 100% !important;
        border-radius: var(--radius-sm) !important;
    }
}

/* ==========================================================================
   ESTILOS DE TABELA E CARDS MOBILE PARA LISTA DE DOAÇÕES
   ========================================================================== */

.table-responsive {
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
}

.table th {
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

/* Card Mobile para Doações */
.donation-mobile-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.donation-mobile-card:active {
    background-color: #f8fafc;
}

/* ==========================================================================
   MEDIA QUERIES E ADAPTAÇÕES DE TELA
   ========================================================================== */

/* Telas Pequenas / Celulares (< 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .gate-card {
        padding: 1.75rem 1.15rem !important;
        border-radius: var(--radius-lg);
    }

    .form-card .card-body {
        padding: 1.25rem 1rem !important;
    }

    .info-card .card-body,
    .donatario-card .card-body {
        padding: 1.25rem 1rem !important;
    }

    .value-card-label {
        padding: 0.75rem 0.5rem !important;
        min-height: 75px;
    }

    .value-card-label .fs-5 {
        font-size: 1.05rem !important;
    }

    .value-card-label .small {
        font-size: 0.75rem !important;
    }

    /* Botões em barra de ação */
    .mobile-stack-btn {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .header-actions .btn {
        width: 100%;
    }

    .footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Telas Médias / Tablets (576px a 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .gate-card {
        padding: 2.25rem 1.75rem !important;
    }
}

/* Animações */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(15px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
