/**
 * Event Registration - Public Styles
 * Version: 1.0.0
 * All classes prefixed with .er- to avoid theme conflicts.
 */

/* ========================================
   Base Reset / Container
   ======================================== */
.er-registration-wrap,
.er-event-list,
.er-cancellation-wrap,
.er-cancellation-form-wrap {
    box-sizing: border-box !important;
    font-family: inherit !important;
    max-width: 680px !important;
    margin: 0 auto 2rem auto !important;
}

.er-registration-wrap *,
.er-event-list *,
.er-cancellation-wrap *,
.er-cancellation-form-wrap * {
    box-sizing: border-box !important;
}

/* ========================================
   Notices
   ======================================== */
.er-notice {
    padding: 12px 16px !important;
    border-radius: 4px !important;
    margin: 1rem 0 !important;
    font-size: 0.95rem !important;
}
.er-notice-warning {
    background: #fff8e1 !important;
    border-left: 4px solid #f59f00 !important;
    color: #6d4c00 !important;
}
.er-notice-error {
    background: #fff5f5 !important;
    border-left: 4px solid #e03131 !important;
    color: #862e2e !important;
}
.er-notice-success {
    background: #ebfbee !important;
    border-left: 4px solid #2f9e44 !important;
    color: #1a5c2a !important;
}
.er-notice-info {
    background: #e8f4fd !important;
    border-left: 4px solid #1971c2 !important;
    color: #0d3c61 !important;
}
.er-error {
    color: #e03131 !important;
    font-size: 0.9rem !important;
}

/* ========================================
   Messages (AJAX responses)
   ======================================== */
.er-messages {
    min-height: 0 !important;
    margin-bottom: 1rem !important;
}
.er-messages:empty {
    display: none !important;
}

/* ========================================
   Event Summary
   ======================================== */
.er-event-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
    color: inherit !important;
}
.er-event-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem 1.5rem !important;
    font-size: 0.9rem !important;
    color: #555 !important;
    margin-bottom: 1.5rem !important;
}
.er-event-meta span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

/* ========================================
   Form Fields
   ======================================== */
.er-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}
.er-field-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
}
.er-field-label {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    display: block !important;
    color: inherit !important;
}
.er-required {
    color: #e03131 !important;
    margin-left: 2px !important;
}
.er-field-help {
    font-size: 0.8rem !important;
    color: #777 !important;
    font-style: italic !important;
}
.er-field-input {
    width: 100% !important;
}
.er-input,
.er-textarea,
.er-select {
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: #333 !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease !important;
    font-family: inherit !important;
}
.er-input:focus,
.er-textarea:focus,
.er-select:focus {
    outline: none !important;
    border-color: #1971c2 !important;
    box-shadow: 0 0 0 3px rgba(25, 113, 194, 0.15) !important;
}
.er-input.er-has-error,
.er-textarea.er-has-error,
.er-select.er-has-error {
    border-color: #e03131 !important;
}
.er-textarea {
    resize: vertical !important;
    min-height: 80px !important;
}
.er-field-error {
    color: #e03131 !important;
    font-size: 0.8rem !important;
    display: block !important;
    min-height: 1rem !important;
}

/* Radio / Checkbox Groups */
.er-radio-group,
.er-checkbox-group {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.er-radio-label,
.er-checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    padding: 0.25rem 0 !important;
}
.er-radio,
.er-checkbox {
    width: auto !important;
    cursor: pointer !important;
}

/* ========================================
   Submit Button / Spinner
   ======================================== */
.er-form-submit {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
}
.er-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.55rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
    text-decoration: none !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}
.er-btn-primary {
    background: #1971c2 !important;
    border-color: #1971c2 !important;
    color: #fff !important;
}
.er-btn-primary:hover,
.er-btn-primary:focus {
    background: #1562a8 !important;
    border-color: #1562a8 !important;
    color: #fff !important;
}
.er-btn-primary:disabled {
    background: #74b0e0 !important;
    border-color: #74b0e0 !important;
    cursor: not-allowed !important;
}
.er-btn-danger {
    background: #e03131 !important;
    border-color: #e03131 !important;
    color: #fff !important;
}
.er-btn-danger:hover,
.er-btn-danger:focus {
    background: #c12a2a !important;
    border-color: #c12a2a !important;
    color: #fff !important;
}

/* Spinner */
.er-spinner {
    display: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 3px solid #ccc !important;
    border-top-color: #1971c2 !important;
    border-radius: 50% !important;
    animation: er-spin 0.7s linear infinite !important;
}
.er-spinner.er-is-active {
    display: inline-block !important;
}
@keyframes er-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Event List
   ======================================== */
.er-event-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
    max-width: 100% !important;
}
.er-event-card {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 1.25rem !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}
.er-event-card-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.5rem 0 !important;
    color: inherit !important;
}
.er-event-card-meta {
    font-size: 0.85rem !important;
    color: #666 !important;
    margin-bottom: 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
}
.er-event-availability {
    margin-bottom: 1rem !important;
}
.er-event-card-actions {
    margin-top: auto !important;
}

/* ========================================
   Badges
   ======================================== */
.er-badge {
    display: inline-block !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 3px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}
.er-badge-available {
    background: #ebfbee !important;
    color: #1a5c2a !important;
}
.er-badge-waitlist {
    background: #fff8e1 !important;
    color: #6d4c00 !important;
}
.er-badge-full {
    background: #fff5f5 !important;
    color: #862e2e !important;
}

/* ========================================
   Cancellation
   ======================================== */
.er-cancellation-wrap,
.er-cancellation-form-wrap {
    max-width: 480px !important;
}
.er-cancellation-info h2 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem !important;
}

/* ========================================
   Screen reader only
   ======================================== */
.er-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   Mobile-first responsive
   ======================================== */
@media (max-width: 600px) {
    .er-event-list {
        grid-template-columns: 1fr !important;
    }
    .er-form-submit {
        flex-wrap: wrap !important;
    }
    .er-btn {
        width: 100% !important;
    }
}
