/* ============================================================
   Margins Event Portal - Public Styles
   Brand: Margins Group (#154bc0, #2991d6, #e4002a)
   ============================================================ */

:root {
    --mg-primary: #154bc0;
    --mg-secondary: #2991d6;
    --mg-accent: #e4002a;
    --mg-dark: #0a0a0a;
    --mg-dark-bg: #0f1b3d;
    --mg-sidebar: #0c1530;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f0f2f5;
    color: var(--mg-dark);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--mg-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Public Container */
.public-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Portal Header with Logo */
.portal-header {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
}
.portal-header img { height: 48px; width: auto; margin-bottom: 0.25rem; }
.portal-header .portal-tagline { font-size: 0.8rem; color: #888; }

/* Event Header */
.event-header {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 12px 12px 0 0;
    color: #fff;
    background: linear-gradient(135deg, var(--mg-sidebar) 0%, var(--mg-dark-bg) 100%);
}
.event-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.event-header .event-meta { font-size: 0.9rem; opacity: 0.9; }
.event-header .portal-logo { height: 50px; width: auto; filter: brightness(0) invert(1); margin-bottom: 0.75rem; }

/* Card */
.public-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}
.public-card-body { padding: 2rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
}
.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 3px rgba(21,75,192,0.15);
}
.form-control.is-invalid { border-color: #ef4444; }
.form-error { color: #ef4444; font-size: 0.8rem; margin-top: 0.25rem; }
.form-text { color: #888; font-size: 0.8rem; margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Category Cards */
.category-grid { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.category-option {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.category-option:hover { border-color: var(--mg-primary); background: #f0f4ff; }
.category-option.selected { border-color: var(--mg-primary); background: #e8eeff; }
.category-option.disabled { opacity: 0.5; cursor: not-allowed; }
.category-option input[type="radio"] { display: none; }
.category-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
}
.category-option.selected .category-dot { border-color: var(--mg-primary); background: var(--mg-primary); }
.category-info { flex: 1; }
.category-name { font-weight: 600; font-size: 1rem; }
.category-desc { font-size: 0.8rem; color: #666; }
.category-price { font-weight: 700; font-size: 1.1rem; color: var(--mg-primary); }
.category-price.free { color: #0d9488; }
.category-full { font-size: 0.8rem; color: var(--mg-accent); font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--mg-primary); color: #fff; }
.btn-primary:hover { background: #103a96; }
.btn-success { background: #0d9488; color: #fff; }
.btn-outline { background: transparent; border: 2px solid #d1d5db; color: #555; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Consent */
.consent-group { margin-top: 0.5rem; }
.consent-label { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; color: #555; cursor: pointer; line-height: 1.5; }
.consent-label input[type="checkbox"] { margin-top: 0.25rem; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--mg-primary); }
.consent-label .required { color: var(--mg-accent); font-weight: 600; }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Success Page */
.success-container { text-align: center; padding: 2rem; }
.success-icon { font-size: 4rem; color: #0d9488; margin-bottom: 1rem; }
.success-title { font-size: 1.5rem; font-weight: 700; color: var(--mg-dark); margin-bottom: 0.5rem; }
.success-text { color: #666; margin-bottom: 1.5rem; }
.reg-code { font-family: monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: 3px; color: var(--mg-primary); background: #e8eeff; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; margin-bottom: 1rem; }

/* Footer */
.public-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: #999;
}

/* Check-in Page */
.checkin-container { max-width: 500px; margin: 0 auto; padding: 2rem 1rem; }
.checkin-result {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}
.checkin-result.success { background: #d1fae5; }
.checkin-result.error { background: #fee2e2; }

/* Responsive */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .public-card-body { padding: 1.25rem; }
    .event-header { padding: 1.5rem 1rem; }
    .event-header h1 { font-size: 1.35rem; }
}
