/* AAP Events Public - Styles */
:root {
    --cornell-red: #b31b1b;
    --cornell-red-dark: #8c1515;
    --cornell-red-light: #df4e4e;
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;
    --color-success: #2e7d32;
    --color-success-bg: #e8f5e9;
    --color-warning: #f57f17;
    --color-warning-bg: #fff8e1;
    --color-error: #c62828;
    --color-error-bg: #fce4ec;
    --color-info: #1565c0;
    --color-info-bg: #e3f2fd;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font-stack);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--cornell-red);
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.app-header h1 { font-size: 18px; font-weight: 600; }

/* Main container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Event display */
.event-header {
    text-align: center;
    margin-bottom: 24px;
}
.event-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}
.event-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-light);
}
.event-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.event-description {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 24px;
    font-size: 15px;
    white-space: pre-wrap;
}

/* Card */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
}
.form-group label .required {
    color: var(--cornell-red);
    margin-left: 2px;
}
.form-group .hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 3px;
}
input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font-stack);
    transition: var(--transition);
    background: #fff;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--cornell-red);
    box-shadow: 0 0 0 2px rgba(179, 27, 27, 0.15);
}
textarea { resize: vertical; min-height: 100px; }
.error-text {
    color: var(--color-error);
    font-size: 13px;
    margin-top: 4px;
}
input.error, textarea.error, select.error {
    border-color: var(--color-error);
}

/* Checkbox / Radio groups */
.choice-group { display: flex; flex-direction: column; gap: 0; }
.choice-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    margin-top: -1px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
}
.choice-item:first-child { border-radius: var(--radius) var(--radius) 0 0; margin-top: 0; }
.choice-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.choice-item:only-child { border-radius: var(--radius); }
.choice-item:hover { border-color: var(--cornell-red-light); z-index: 1; }
.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
    width: 20px; height: 20px;
    min-width: 20px;
    margin-right: 8px;
    accent-color: var(--cornell-red);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--cornell-red);
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}
.btn-primary:hover:not(:disabled) { background: var(--cornell-red-dark); }
.btn-secondary { background: #e0e0e0; color: var(--color-text); }
.btn-secondary:hover:not(:disabled) { background: #d0d0d0; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-error { background: var(--color-error-bg); color: var(--color-error); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }

/* Fee notice */
.fee-notice {
    background: var(--color-warning-bg);
    border: 1px solid #ffcc02;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #5d4e00;
}
.fee-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--cornell-red);
}

/* Registration info */
.reg-info {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.reg-info dt { font-weight: 600; color: var(--color-text-light); margin-top: 8px; }
.reg-info dt:first-child { margin-top: 0; }
.reg-info dd { margin-left: 0; }

/* Success state */
.success-card {
    text-align: center;
    padding: 32px 20px;
}
.success-icon {
    font-size: 48px;
    color: var(--color-success);
    margin-bottom: 12px;
}
.success-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
}
.success-card p {
    color: var(--color-text-light);
    margin-bottom: 16px;
}

/* Closed / full states */
.closed-notice {
    text-align: center;
    padding: 32px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.closed-notice h2 { font-size: 20px; margin-bottom: 8px; }
.closed-notice p { color: var(--color-text-light); }

/* Not found */
.not-found {
    text-align: center;
    padding: 64px 20px;
}
.not-found h2 { font-size: 22px; margin-bottom: 8px; color: var(--color-text-light); }
.not-found p { color: var(--color-text-muted); }

/* Toast */
.toast-container {
    position: fixed;
    top: 64px;
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}
.toast-success { background: var(--color-success); color: #fff; }
.toast-error { background: var(--color-error); color: #fff; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 16px 12px; }
    .card { padding: 16px; }
    .event-header h2 { font-size: 22px; }
}

.hidden { display: none !important; }