:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --text-main: #212529;
    --text-muted: #6c757d;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px 0;
    line-height: 1.6;
    font-size: 0.9rem; /* Set base font size to 0.9rem */
}

/* Global Text Overrides for consistency */
p, .btn, .form-control, .alert, .list-group-item, .modal-body {
    font-size: 0.9rem !important;
}

small, .text-small, .text-muted {
    font-size: 0.8rem !important;
}

/* Bootstrap Heading Overrides */
h1, .h1 { font-size: 2.2rem; }
h2, .h2 { font-size: 1.7rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.3rem; }
h5, .h5 { font-size: 1.1rem; }
h6, .h6 { font-size: 0.9rem; }

/* Container & Card */
.form-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.02);
    max-width: 700px;
    width: 660px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.form-header img {
    max-height: 60px;
    margin-bottom: 20px;
}

.form-header h2 {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.5rem; /* Reduced from 1.75rem */
    letter-spacing: -0.5px;
}

.section-title {
    font-size: 1rem; /* Reduced from 1.1rem */
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem; /* Reduced from 0.9rem */
}

/* Event Grid & Checkbox */
.event-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.event-grid.single-column {
    grid-template-columns: 1fr;
}

/* Hidden Checkbox Input */
.event-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Event Card Label */
.event-card-label {
    display: flex;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
    position: relative;
    overflow: hidden;
}

.event-card-label:hover {
    border-color: #a6c8ff;
    background-color: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
}

/* Checked State */
.event-checkbox-input:checked + .event-card-label {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

/* Custom Checkbox Indicator */
.custom-checkbox {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #adb5bd;
    border-radius: 4px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: white;
    margin-top: 2px;
}

.event-checkbox-input:checked + .event-card-label .custom-checkbox {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    animation: bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.event-checkbox-input:checked + .event-card-label .custom-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

/* Event Details */
.event-content { flex: 1; }

.event-name {
    font-weight: 600;
    font-size: 0.95rem; /* Reduced from 1.05rem */
    color: #212529;
    margin-bottom: 6px;
    display: block;
    line-height: 1.2;
}

.event-meta {
    font-size: 0.75rem; /* Reduced from 0.8rem */
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.event-topic {
    display: inline-block;
    font-size: 0.75rem; /* Reduced from 0.85rem */
    color: #495057;
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 10px;
    font-weight: 500;
}

/* Participant Type Selector */
.participant-type-wrapper {
    background: #f8f9fa;
    padding: 6px;
    border-radius: 12px;
    display: flex;
    gap: 6px;
}

.type-option {
    flex: 1;
    position: relative;
}

.type-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    border: 1px solid transparent;
    user-select: none;
    height: 100%;
}

.type-option input:checked + .type-label {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-weight: 600;
}

.type-option:hover .type-label {
    color: var(--text-main);
}

/* Form Inputs */
.form-group label {
    font-weight: 500;
    font-size: 0.9rem; /* Reduced from 0.95rem */
    margin-bottom: 8px;
    color: #495057;
}

.required-field::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
}

.form-control {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    font-size: 0.9rem; /* Reduced from 0.95rem */
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem; /* Reduced from 1rem */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    transition: var(--transition);
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
}

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

/* Loading Overlay */
#loadingOverlay { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(255,255,255,0.9); 
    z-index: 9999; 
    align-items: center; 
    justify-content: center; 
    flex-direction: column; 
    backdrop-filter: blur(2px);
}

.hidden { display: none !important; }

@keyframes bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (max-width: 690px) {
    body { padding: 20px 15px; }
    .form-container { padding: 5px; }
    .form-header h2 { font-size: 1.5rem; }
    .event-card-label { padding: 15px; }
    .event-grid { grid-template-columns: 1fr; }
}

/* Access Denied / Error Page Styles */
.card-error { 
    border: none; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    background: white;
}
.card-body-error { padding: 40px; text-align: center; }
.icon-box-error { 
    width: 80px; height: 80px; 
    background: #ffebee; 
    color: #dc3545; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 32px; 
    margin: 0 auto 20px;
}
