/* ============================================================
   Sistema de Eventos — style.css
   Colors: #03357A (primary), #ffcc11 (accent), #ffffff (white)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #03357A;
    --primary-dark:  #02275c;
    --accent:        #ffcc11;
    --accent-dark:   #e6b800;
    --white:         #ffffff;
    --text:          #1a1a2e;
    --text-muted:    #6c757d;
    --bg:            #f8f9fa;
    --border:        #dee2e6;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.08);
    --shadow:        0 2px 12px rgba(0,0,0,.10);
    --shadow-lg:     0 6px 30px rgba(0,0,0,.14);
    --radius:        8px;
    --radius-lg:     14px;
    --transition:    .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--white);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -.3px;
    white-space: nowrap;
}
.navbar-brand:hover { color: var(--accent); text-decoration: none; }
.brand-icon { font-size: 1.4rem; color: var(--accent); }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.navbar-menu ul {
    display: flex;
    list-style: none;
    gap: .1rem;
    align-items: center;
    margin: 0;
}
.navbar-menu ul a {
    display: block;
    padding: .45rem .75rem;
    color: rgba(255,255,255,.87);
    border-radius: var(--radius);
    font-size: .93rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.navbar-menu ul a:hover,
.navbar-menu ul a.active {
    background: rgba(255,255,255,.12);
    color: var(--accent);
    text-decoration: none;
}

.btn-login {
    display: inline-block;
    margin-left: .75rem;
    padding: .4rem 1rem;
    background: var(--accent);
    color: var(--primary);
    font-weight: 700;
    border-radius: var(--radius);
    font-size: .88rem;
    transition: background var(--transition), transform var(--transition);
}
.btn-login:hover { background: var(--accent-dark); color: var(--primary); text-decoration: none; transform: translateY(-1px); }

/* Hamburger Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: .5rem;
    background: none;
    border: none;
    cursor: pointer;
}
.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Hero / Page Hero --- */
.hero {
    background: #f8f9fa;
    color: var(--text);
    padding: 4rem 0 3rem;
}
/*.home-content { max-width: 800px; }*/
.home-content h1, .home-content h2 { color: var(--text); margin-bottom: .75rem; }
.home-content p { color: var(--text-muted); font-size: 1.1rem; }

.page-hero {
    background: var(--primary);
    color: var(--white);
    padding: 2.5rem 0 2rem;
}
.page-hero-title { font-size: 2rem; font-weight: 700; margin-bottom: .25rem; }
.page-hero-sub { color: rgba(255,255,255,.75); }

/* --- Category Quick Links --- */
.category-links { padding: 2.5rem 0; background: var(--bg); }
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1.75rem 1rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: .95rem;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    text-decoration: none;
}
.category-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.cat-icon { font-size: 2rem; }

/* --- Section --- */
.section { padding: 3rem 0; }
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.75rem;
    padding-bottom: .5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* --- Events Grid & Cards --- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.event-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.event-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.card-image-link { display: block; overflow: hidden; position: relative; }

/* --- Card ribbon overlay --- */
.card-ribbon {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(45deg);
    transform-origin: top left;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.card-ribbon--yellow { background: var(--accent); color: #1a1a2e; }
.card-ribbon--red    { background: #dc3545; color: #fff; }
.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform .35s ease;
}
.event-card:hover .card-image { transform: scale(1.04); }
.card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary) 0%, #0552b5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.1rem 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--primary); }

.card-meta {
    font-size: .85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}
.meta-icon { font-size: 1em; flex-shrink: 0; }

.card-action { margin-top: auto; padding-top: .75rem; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: .2em .65em;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-type { background: var(--primary); color: var(--white); }
.badge-type.badge-lg { font-size: .82rem; padding: .3em .8em; }
.badge-success   { background: #198754; color: #fff; }
.badge-warning   { background: var(--accent); color: var(--primary); }
.badge-danger    { background: #dc3545; color: #fff; }
.badge-secondary { background: #6c757d; color: #fff; }

/* Status badges */
.badge-pending  { background: #fd7e14; color: #fff; }
.badge-approved { background: #198754; color: #fff; }
.badge-rejected { background: #dc3545; color: #fff; }
.badge-waitlist { background: #0dcaf0; color: #000; }

/* --- Buttons (Bootstrap handles base sizing; overrides below for brand colours) --- */
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }

.btn-warning { background: var(--accent); border-color: var(--accent); color: var(--primary); }
.btn-warning:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--primary); }

.btn-secondary { background: #6c757d; border-color: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; border-color: #5a6268; color: #fff; }

.btn-success { background: #198754; border-color: #198754; color: #fff; }
.btn-success:hover { background: #157347; border-color: #157347; }

.btn-danger { background: #dc3545; border-color: #dc3545; color: #fff; }
.btn-danger:hover { background: #bb2d3b; border-color: #bb2d3b; }

/* --- Alerts --- */
.alert {
    padding: .85rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .94rem;
    border-left: 4px solid transparent;
}
.alert-success { background: #d1e7dd; color: #0f5132; border-color: #198754; }
.alert-danger   { background: #f8d7da; color: #842029; border-color: #dc3545; }
.alert-warning  { background: #fff3cd; color: #664d03; border-color: var(--accent); }
.alert-info     { background: #cff4fc; color: #055160; border-color: #0dcaf0; }

/* --- Forms --- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
    font-size: .93rem;
    color: var(--text);
}
.required { color: #dc3545; margin-left: .1em; }
.form-control {
    display: block;
    width: 100%;
    padding: .55rem .85rem;
    font-size: .95rem;
    color: var(--text);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.5;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3,53,122,.15);
}
.form-control.is-invalid { border-color: #dc3545; }
.form-error { display: block; color: #dc3545; font-size: .83rem; margin-top: .25rem; }
.form-hint { color: var(--text-muted); font-size: .81rem; margin-top: .25rem; display: block; }

.has-error .form-control { border-color: #dc3545; }

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: .35rem;
}
.checkbox-group,
.radio-group { display: flex; flex-direction: column; gap: .25rem; }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { height: auto; }
.form-control-sm { height: auto; }

.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 180px; }
.col-4 { flex: 0 0 calc(33.33% - .67rem); }
.col-6 { flex: 0 0 calc(50% - .5rem); }
.col-8 { flex: 0 0 calc(66.66% - .5rem); }

/* --- Form Card (Registration / public forms) --- */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 720px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}
.form-card h2 { margin-bottom: 1.5rem; color: var(--primary); }

/* Success card */
.success-card { text-align: center; padding: 3rem 2rem; }
.success-icon { font-size: 4rem; color: #198754; margin-bottom: 1rem; }
.success-card h1 { color: #198754; margin-bottom: .75rem; }
.token-info {
    display: inline-block;
    margin: 1rem 0;
    padding: .5rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: .85rem;
    word-break: break-all;
}

/* --- Register page special --- */
.register-event-summary {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.register-event-thumb {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}
.register-event-title { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin: .25rem 0; }

/* --- Event Detail Page --- */
.event-banner { width: 100%; max-height: 400px; overflow: hidden; }
.event-banner-img { width: 100%; height: 400px; object-fit: cover; }

.event-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    padding: 2.5rem 0;
}

.event-title { font-size: 2rem; font-weight: 700; margin: .5rem 0 1.25rem; line-height: 1.2; }

.event-description {
    line-height: 1.8;
    color: var(--text);
}
.event-description h1,.event-description h2,.event-description h3 { margin: 1.25rem 0 .5rem; color: var(--primary); }
.event-description p  { margin-bottom: .85rem; }
.event-description ul,.event-description ol { padding-left: 1.5rem; margin-bottom: .85rem; }
.event-description a  { color: var(--primary); }

.payment-box {
    background: #fff3cd;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
}
.payment-box h3 { color: #664d03; margin-bottom: .5rem; }

.info-box {
    background: #e8f4fd;
    border: 1px solid #b6d9f7;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    color: #0c4a6e;
    line-height: 1.6;
}
.info-box hr { border: none; border-top: 1px solid #b6d9f7; margin: .75rem 0; }
.info-box p { margin: 0 0 .5rem; }
.info-box p:last-child { margin-bottom: 0; }

.rules-pdf-box {
    margin-top: 1.5rem;
}

/* Sidebar */
.sidebar-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}
.sidebar-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--primary); }
.sidebar-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .2rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .92rem;
}
.sidebar-row:last-of-type { border-bottom: none; }
.sidebar-label { font-weight: 700; color: var(--text-muted); font-size: .82rem; }
.approval-notice { background: #fff3cd; border-radius: var(--radius); padding: .65rem; border: none; }
.sidebar-action { margin-top: 1.25rem; }
.sidebar-action .btn { display: block; text-align: center; width: 100%; }

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    justify-content: center;
}
.page-link {
    display: inline-block;
    padding: .4rem .8rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--primary);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.page-link:hover { background: var(--primary); color: var(--white); border-color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); pointer-events: none; }

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.8);
    padding: 2.5rem 0;
    margin-top: 4rem;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}
.footer-brand { font-size: 1.15rem; font-weight: 700; color: var(--white); }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: rgba(255,255,255,.75); font-size: .9rem; text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-copy { font-size: .82rem; color: rgba(255,255,255,.5); }

/* --- Misc utilities --- */
.text-muted { color: var(--text-muted); }
.main-content { min-height: calc(100vh - 64px - 180px); }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .events-grid    { grid-template-columns: repeat(2, 1fr); }
    .category-grid  { grid-template-columns: repeat(2, 1fr); }
    .event-detail-layout { grid-template-columns: 1fr; }
    .sidebar-card { position: static; }
    .col-4, .col-6, .col-8 { flex: 0 0 100%; }
}

/* Mobile */
@media (max-width: 640px) {
    .events-grid  { grid-template-columns: 1fr; }
    .navbar-toggle { display: flex; }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 8px 20px rgba(0,0,0,.2);
    }
    .navbar-menu.open { display: flex; }
    .navbar-menu ul { flex-direction: column; width: 100%; }
    .navbar-menu ul a { display: block; padding: .7rem 1rem; }
    .btn-login { margin: .5rem 0 0; width: 100%; text-align: center; }
    .navbar-inner { position: relative; }

    .hero, .page-hero { padding: 2rem 0; }
    .page-hero-title { font-size: 1.5rem; }
    .register-event-summary { flex-direction: column; }
    .form-card { padding: 1.25rem; }
    .event-detail-layout { padding: 1.5rem 0; }
    .event-title { font-size: 1.5rem; }
}
