/* ==========================================================================
   DESIGN SYSTEM & VARIÁVEIS CSS (TEMA RED VINHO - CAPED)
   ========================================================================== */
:root {
    /* Paleta de Cores HSL - Vermelho Vinho (inspirado no CAPED) */
    --primary-h: 0;
    --primary-s: 69%;
    --primary-l: 32%; /* Vermelho Vinho elegante */
    
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 96%);
    
    --success: hsl(142, 72%, 29%);
    --success-light: hsl(142, 70%, 95%);
    
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 90%, 96%);
    
    --neutral-dark: hsl(220, 24%, 12%);
    --neutral-body: hsl(215, 16%, 38%);
    --neutral-light: hsl(210, 20%, 97%);
    --neutral-border: hsl(215, 14%, 89%);
    --white: #ffffff;
    
    /* Tipografia */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Espaçamentos e Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 4px 6px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & ESTILOS DE BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--neutral-light);
    color: var(--neutral-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 0;
    
    /* Ativação do Flexbox no Body para suporte a Sticky Footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Layout Wrapper - Ocupa todo o espaço vertical disponível */
.main-wrapper {
    flex: 1 0 auto;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

/* Espaçamento superior automático em páginas sem Hero (ex: comprovante.php) */
.main-wrapper > .container:first-child {
    padding-top: 40px;
    padding-bottom: 48px;
}

/* ==========================================================================
   BARRA DE NAVEGAÇÃO SUPERIOR (NAVBAR)
   ========================================================================== */
.navbar {
    background-color: var(--white);
    border-bottom: 1.5px solid var(--neutral-border);
    min-height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0; /* Garante que a navbar não encolha */
}

.navbar-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    align-items: center;
}

.btn-navbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 700;
    color: var(--neutral-dark);
    text-decoration: none;
    background-color: var(--neutral-light);
    border: 1.5px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-navbar:hover {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(139, 26, 26, 0.15);
}

.btn-navbar:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 16px;
    }
    .navbar-brand {
        font-size: 16px;
    }
    .btn-navbar {
        padding: 6px 12px;
        font-size: 12.5px;
    }
}

/* ==========================================================================
   SEÇÃO HERO (FUNDO DO EVENTO & INFORMAÇÕES)
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-position: center;
    padding: 56px 20px 96px 20px;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.94));
    z-index: 1;
}

.hero-content {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.hero-badge {
    background-color: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hero-title {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.hero-subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    line-height: 1.4;
    font-weight: 400;
}

.hero-theme-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 6px;
    margin-bottom: 24px;
}

.theme-label {
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    letter-spacing: 1px;
}

.theme-quote {
    font-weight: 700;
    font-style: italic;
    font-size: 14px;
}

.theme-reference {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Grade de mini-cards informativos rápidos */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.info-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    transition: var(--transition);
}

.info-card:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.info-card-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-card-icon svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    display: inline-block;
}

.info-card-text h4 {
    font-size: 11.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-card-text p {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.35;
}

.info-card-text .address-detail,
.info-card-text .email-detail {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
    margin-top: 2px;
    word-break: break-all;
}

/* Responsividade do Hero */
@media (max-width: 860px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 40px 16px 80px 16px;
    }
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hero-title {
        font-size: 26px;
    }
    .hero-subtitle {
        font-size: 14px;
    }
    .theme-quote {
        font-size: 12.5px;
    }
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (CARD DO FORMULÁRIO SOBREPOSTO)
   ========================================================================== */
.main-content-wrapper {
    margin-top: -48px;
    position: relative;
    z-index: 10;
    padding-bottom: 48px;
}

/* ==========================================================================
   COMPONENTES - CARTÕES (CARDS)
   ========================================================================== */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-border);
}

@media (max-width: 480px) {
    .card {
        padding: 24px 16px;
        border-radius: var(--radius-md);
    }
}

.card-form-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--neutral-dark);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.card-form-desc {
    font-size: 13.5px;
    color: var(--neutral-body);
    text-align: center;
    margin-bottom: 24px;
}

/* ==========================================================================
   FORMULÁRIOS & CAMPOS DE ENTRADA
   ========================================================================== */
.form-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-group-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.flex-grow {
    flex-grow: 1;
}

@media (max-width: 480px) {
    .form-group-row {
        flex-direction: column;
        gap: 12px;
    }
    .form-group-row .btn {
        width: 100%;
    }
}

input[type="text"],
select {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    font-family: var(--font-family);
    font-size: 14.5px;
    border: 1.5px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    color: var(--neutral-dark);
    outline: none;
    transition: var(--transition);
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6b73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
    padding-right: 40px;
}

input[type="text"]::placeholder {
    color: var(--neutral-body);
    opacity: 0.7;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 26, 26, 0.12);
    background-color: var(--white);
}

.dynamic-group {
    animation: expandInput 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.form-notice-text {
    font-size: 12.5px;
    color: var(--neutral-body);
    margin: 4px 0 8px 0;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
}

/* ==========================================================================
   BOTÕES & LOADING SPINNER
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 24px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.5px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(139, 26, 26, 0.15);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(139, 26, 26, 0.25);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--neutral-light);
    color: var(--neutral-dark);
    border: 1.5px solid var(--neutral-border);
}

.btn-secondary:hover {
    background-color: var(--neutral-border);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: rotateSpinner 0.8s linear infinite;
    margin-left: 10px;
}

.btn-secondary .spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--neutral-dark);
}

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

/* ==========================================================================
   TELA DE PAGAMENTO PIX
   ========================================================================== */
.alert-box {
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-box.warning {
    background-color: var(--warning-light);
    border-left-color: var(--warning);
    color: hsl(38, 80%, 20%);
}

.qrcode-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--neutral-light);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px auto;
    max-width: 200px;
}

.qrcode-img {
    width: 100%;
    height: auto;
    display: block;
}

.pix-action-container {
    text-align: center;
    margin-bottom: 24px;
}

.pix-info {
    font-size: 12.5px;
    color: var(--neutral-body);
    margin-top: 10px;
    line-height: 1.4;
}

.payment-offline-note {
    background-color: var(--neutral-light);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
    border: 1.5px dashed var(--neutral-border);
}

.link-comprovante-texto {
    color: var(--primary);
    word-break: break-all;
    margin-top: 6px;
    font-size: 12.5px;
}

/* ==========================================================================
   ENVIO DE COMPROVANTE & BUSCA (comprovante.php)
   ========================================================================== */
.divider {
    border: 0;
    height: 1px;
    background-color: var(--neutral-border);
    margin: 24px 0;
}

.result-box {
    animation: expandInput 0.3s ease-out;
}

.registration-info {
    background-color: var(--neutral-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border: 1.5px solid var(--neutral-border);
}

.info-item {
    font-size: 14.5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-value {
    font-weight: 700;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pago,
.status-badge.confirmado,
.status-badge.sucesso {
    background-color: var(--success-light);
    color: var(--success);
}

.status-badge.pendente,
.status-badge.aguardando {
    background-color: var(--warning-light);
    color: var(--warning);
}

.file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--neutral-border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--neutral-light);
}

.file-dropzone:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--neutral-body);
    margin-bottom: 12px;
    transition: var(--transition);
}

.file-dropzone:hover .upload-icon {
    color: var(--primary);
    transform: translateY(-2px);
}

.dropzone-text {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--neutral-dark);
    margin-bottom: 4px;
}

.dropzone-sub {
    font-size: 12px;
    color: var(--neutral-body);
}

.file-selected-name {
    background-color: var(--primary-light);
    border: 1.5px solid rgba(139, 26, 26, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 13.5px;
    color: hsl(var(--primary-h), var(--primary-s), 22%);
    animation: expandInput 0.2s ease-out;
    word-break: break-all;
}

.back-link-container {
    text-align: center;
    margin-top: 24px;
}

.back-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--neutral-body);
    text-decoration: none;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

/* ==========================================================================
   NOVO RODAPÉ INSTITUCIONAL (FOOTER)
   ========================================================================== */
.footer {
    background-color: var(--neutral-dark);
    color: rgba(255, 255, 255, 0.65);
    padding: 40px 0 0 0;
    border-top: 1.5px solid var(--neutral-border);
    width: 100%;
    flex-shrink: 0; /* Impede o rodapé de encolher */
    z-index: 10;
}

.footer-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 40px;
}

.footer-brand-column {
    flex: 1;
    max-width: 320px;
}

.footer-brand-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.footer-brand-desc {
    font-size: 13px;
    line-height: 1.5;
}

.footer-info-column {
    flex: 1.5;
    display: flex;
    justify-content: flex-end;
}

.footer-info-block {
    max-width: 480px;
}

.footer-info-block strong {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-info-block p {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.45;
}

.footer-info-block p:last-child {
    margin-bottom: 0;
}

/* Faixa Preta de Copyright */
.footer-bottom {
    background-color: hsl(220, 24%, 8%);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-container p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2px;
}

/* Responsividade do Rodapé */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 24px;
        padding-bottom: 32px;
    }
    .footer-brand-column {
        max-width: 100%;
    }
    .footer-info-column {
        justify-content: flex-start;
    }
}
