/* CCA Course Bookings - Public Styles */

.cca-booking-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
}

/* Course cards */
.cca-course-list {
    display: grid;
    gap: 1.25rem;
}

.cca-course-card {
    background: #fff;
    border: 1px solid #dde3ee;
    border-radius: 6px;
    padding: 1.5rem;
}

.cca-course-card--full {
    opacity: 0.85;
}

.cca-course-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cca-course-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e4d8c;
}

.cca-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cca-badge--full {
    background: #f0f0f0;
    color: #666;
}

.cca-badge--low {
    background: #fff4e5;
    color: #b35c00;
}

.cca-course-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #1a1a1a;
}

.cca-course-card__meta {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.8;
}

/* Buttons */
.cca-btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
}

.cca-btn--primary {
    background: #1e4d8c;
    color: #fff;
}

.cca-btn--primary:hover {
    background: #163a6a;
}

.cca-btn--secondary {
    background: #f0f4fb;
    color: #1e4d8c;
    border: 1px solid #c5d3e8;
}

.cca-btn--secondary:hover {
    background: #e2eaf7;
}

.cca-btn--ghost {
    background: transparent;
    color: #1e4d8c;
    border: 1px solid #c5d3e8;
    font-size: 0.875rem;
}

.cca-btn--ghost:hover {
    background: #f0f4fb;
}

.cca-btn--full {
    width: 100%;
    text-align: center;
    padding: 0.85rem;
    font-size: 1rem;
}

.cca-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Back button */
.cca-back-btn {
    background: none;
    border: none;
    color: #1e4d8c;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 1rem;
    display: block;
    text-decoration: underline;
}

/* Booking form */
.cca-form-wrap h2 {
    margin: 0.5rem 0 1.5rem;
    font-size: 1.4rem;
}

.cca-section {
    margin-bottom: 2rem;
}

.cca-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e4d8c;
    margin: 0 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e5eaf4;
}

.cca-field {
    margin-bottom: 0.875rem;
}

.cca-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #333;
}

.cca-field input,
.cca-field textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #c8d0de;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.cca-field input:focus,
.cca-field textarea:focus {
    border-color: #1e4d8c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 77, 140, 0.12);
}

.cca-field--inline {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.cca-field--inline input {
    flex: 1;
}

.cca-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 520px) {
    .cca-field-group {
        grid-template-columns: 1fr;
    }
}

.cca-required {
    color: #c0392b;
}

.cca-hint {
    font-size: 0.85rem;
    color: #666;
    margin: -0.5rem 0 1rem;
}

/* Participants */
.cca-participant-row {
    background: #f7f9fc;
    border: 1px solid #dde3ee;
    border-radius: 5px;
    padding: 1rem 1rem 0.25rem;
    margin-bottom: 0.875rem;
}

.cca-participant-row__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cca-participant-row__header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #1e4d8c;
}

.cca-remove-participant {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
}

/* Order summary */
.cca-order-summary {
    background: #f7f9fc;
    border: 1px solid #dde3ee;
    border-radius: 5px;
    padding: 1rem;
}

.cca-order-summary h3 {
    border-bottom-color: #c5d3e8;
}

.cca-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.35rem 0;
    color: #444;
}

.cca-summary-line--discount {
    color: #2e7d32;
}

.cca-summary-line--total {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a1a;
    border-top: 1px solid #c5d3e8;
    margin-top: 0.35rem;
    padding-top: 0.6rem;
}

/* Messages */
.cca-msg {
    display: inline-block;
    font-size: 0.875rem;
    margin-top: 0.4rem;
}

.cca-msg--success { color: #2e7d32; }
.cca-msg--error   { color: #c0392b; }

#cca-payment-message {
    margin-top: 0.75rem;
}

#cca-payment-element {
    margin-bottom: 1.25rem;
}

/* Success */
.cca-success-box {
    background: #f0f9f0;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
}

.cca-success-box h2 {
    color: #2e7d32;
    margin-top: 0;
}

/* No courses */
.cca-no-courses {
    color: #555;
}

/* Admin status badges */
.cca-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.cca-status--active  { background: #e8f5e9; color: #2e7d32; }
.cca-status--paid    { background: #e8f5e9; color: #2e7d32; }
.cca-status--full    { background: #fff3e0; color: #e65100; }
.cca-status--pending { background: #fff3e0; color: #e65100; }
.cca-status--failed  { background: #ffebee; color: #c62828; }
.cca-status--cancelled { background: #f5f5f5; color: #757575; }


/* ---------------------------------------------------------------
   Events
   --------------------------------------------------------------- */

.cca-events-wrap {
    max-width: 760px;
    margin: 0 auto;
}

.cca-events-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.cca-view-toggle {
    display: flex;
    border: 1px solid #c5d3e8;
    border-radius: 4px;
    overflow: hidden;
}

.cca-view-btn {
    background: #fff;
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: #555;
    border-right: 1px solid #c5d3e8;
}

.cca-view-btn:last-child { border-right: none; }

.cca-view-btn--active {
    background: #1e4d8c;
    color: #fff;
}

/* Event cards */
.cca-event-card {
    display: flex;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #dde3ee;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.cca-event-card__date {
    flex-shrink: 0;
    text-align: center;
    background: #1e4d8c;
    color: #fff;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    min-width: 52px;
}

.cca-event-card__day {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.cca-event-card__month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.cca-event-card__body {
    flex: 1;
}

.cca-event-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #1a1a1a;
}

.cca-event-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.cca-event-card__meta span::before {
    content: '';
}

.cca-event-card__desc {
    font-size: 0.9rem;
    color: #555;
    margin: 0.5rem 0 0;
}

.cca-recurrence-badge {
    display: inline-block;
    background: #e8eff9;
    color: #1e4d8c;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.cca-cal-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.cca-cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    border: 1px solid;
}

.cca-cal-btn--google {
    background: #fff;
    color: #1e4d8c;
    border-color: #c5d3e8;
}

.cca-cal-btn--google:hover {
    background: #f0f4fb;
    color: #1e4d8c;
    text-decoration: none;
}

.cca-cal-btn--ics {
    background: #fff;
    color: #555;
    border-color: #ddd;
}

.cca-cal-btn--ics:hover {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

/* Gated message */
.cca-gated {
    background: #f7f9fc;
    border: 1px solid #dde3ee;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    color: #555;
}

/* Calendar */
.cca-calendar-month {
    margin-bottom: 2rem;
}

.cca-calendar-month__label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e4d8c;
    margin: 0 0 0.75rem;
}

.cca-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cca-cal-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    padding: 0.4rem 0;
}

.cca-cal-day {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 3px;
    min-height: 60px;
    padding: 4px;
    font-size: 0.8rem;
}

.cca-cal-day--empty {
    background: transparent;
    border: none;
}

.cca-cal-day--today {
    border-color: #1e4d8c;
}

.cca-cal-day__num {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.cca-cal-day--today .cca-cal-day__num {
    color: #1e4d8c;
}

.cca-cal-event {
    background: #1e4d8c;
    color: #fff;
    border-radius: 2px;
    padding: 1px 4px;
    font-size: 0.7rem;
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 540px) {
    .cca-event-card { flex-wrap: wrap; }
    .cca-cal-links  { flex-direction: column; }
}

/* ---------------------------------------------------------------
   My Membership
   --------------------------------------------------------------- */

.cca-my-membership {
    max-width: 680px;
    margin: 0 auto;
}

.cca-mm-notice {
    padding: 0.875rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
}

.cca-mm-notice--success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.cca-mm-notice--error {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #c62828;
}

/* Membership card */
.cca-mm-card {
    background: linear-gradient(135deg, #1e4d8c 0%, #2a6fc7 100%);
    border-radius: 8px;
    padding: 1.75rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.cca-mm-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.cca-mm-card__name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #fff;
}

.cca-mm-card__type {
    font-size: 0.85rem;
    color: #c8d9f0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cca-mm-card__status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 20px;
}

.cca-mm-card__status--active    { background: rgba(255,255,255,0.2); color: #fff; }
.cca-mm-card__status--expired   { background: rgba(255,100,80,0.3);  color: #ffcdd2; }
.cca-mm-card__status--pending   { background: rgba(255,200,0,0.3);   color: #fff9c4; }
.cca-mm-card__status--suspended { background: rgba(0,0,0,0.2);       color: #eee; }

.cca-mm-card__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.cca-mm-card__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cca-mm-card__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #c8d9f0;
}

.cca-mm-card__value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.cca-mm--due-soon { color: #ffe082; }
.cca-mm--overdue  { color: #ef9a9a; }

/* Renewal / expiry alert */
.cca-mm-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.cca-mm-alert--warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #5d4037;
}

.cca-mm-alert--error {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #c62828;
}

.cca-mm-renew-btn {
    background: #1e4d8c;
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cca-mm-renew-btn:hover {
    background: #163a6e;
    color: #fff;
    text-decoration: none;
}

/* Form sections */
.cca-mm-section {
    background: #fff;
    border: 1px solid #dde3ee;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.cca-mm-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #1a1a1a;
}

.cca-mm-hint {
    font-size: 0.875rem;
    color: #777;
    margin: 0 0 1.25rem;
}

.cca-mm-form__group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eef0f4;
}

.cca-mm-form__group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cca-mm-form__group h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin: 0 0 1rem;
}

.cca-mm-privacy-note {
    font-size: 0.8rem;
    color: #888;
    background: #f7f9fc;
    border: 1px solid #e4eaf4;
    border-radius: 4px;
    padding: 0.6rem 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cca-mm-form__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eef0f4;
    margin-top: 1.5rem;
}

.cca-mm-saving { font-size: 0.875rem; color: #888; }
.cca-mm-saved  { font-size: 0.875rem; color: #2e7d32; font-weight: 600; }
.cca-mm-save-error { font-size: 0.875rem; color: #c62828; }

@media (max-width: 480px) {
    .cca-mm-card__header { flex-direction: column; gap: 0.75rem; }
    .cca-mm-card__fields { grid-template-columns: 1fr 1fr; }
}

/* Committee role badge on membership card */
.cca-mm-card__committee {
    display: block;
    font-size: 0.8rem;
    color: #c8d9f0;
    margin-top: 3px;
    font-style: italic;
}

/* AGB status colours */
.cca-mm--active   { color: #a5d6a7; }
.cca-mm--inactive { color: #ef9a9a; }

/* Linked members list */
.cca-mm-linked-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cca-mm-linked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: #f7f9fc;
    border: 1px solid #dde3ee;
    border-radius: 5px;
}

.cca-mm-linked-item__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cca-mm-linked-item__info span {
    font-size: 0.85rem;
    color: #666;
}

.cca-mm-manage-btn {
    background: #1e4d8c;
    color: #fff;
    padding: 0.35rem 0.875rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.cca-mm-manage-btn:hover {
    background: #163a6e;
    color: #fff;
    text-decoration: none;
}

/* Alert sub-text */
.cca-mm-alert__sub {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    opacity: 0.85;
}

@media (max-width: 480px) {
    .cca-mm-linked-item { flex-direction: column; align-items: flex-start; }
}

/* -----------------------------------------------------------------------
   Membership Application Form - append to cca-public.css
   ----------------------------------------------------------------------- */

.cca-appform-wrap {
    max-width: 720px;
}

.cca-form-intro {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.cca-appform {
    display: flex;
    flex-direction: column;
}

.cca-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.cca-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cca-field.cca-full  { flex: 1 1 100%; }
.cca-field.cca-half  { flex: 1 1 calc(50% - 10px); min-width: 0; }

.cca-field label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.cca-req {
    color: #c0392b;
    margin-left: 2px;
}

.cca-optional {
    font-weight: 400;
    color: #888;
    font-size: 13px;
    margin-left: 4px;
}

.cca-field input[type="text"],
.cca-field input[type="email"],
.cca-field input[type="tel"],
.cca-field select,
.cca-field textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.cca-field input:focus,
.cca-field select:focus,
.cca-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

.cca-field textarea {
    resize: vertical;
    min-height: 90px;
}

.cca-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.cca-submit-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}

.cca-submit-btn:hover    { background: #333; }
.cca-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.cca-form-messages {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.cca-form-messages.cca-success {
    background: #edf7ed;
    border: 1px solid #4caf50;
    color: #2e7d32;
    display: block;
}

.cca-form-messages.cca-error {
    background: #fdecea;
    border: 1px solid #f44336;
    color: #c62828;
    display: block;
}

.cca-form-notice {
    padding: 16px;
    background: #f5f5f5;
    border-left: 4px solid #ccc;
    color: #555;
    font-size: 15px;
}

@media (max-width: 600px) {
    .cca-form-row {
        flex-direction: column;
        gap: 0;
    }
    .cca-field.cca-half {
        flex: 1 1 100%;
        margin-bottom: 20px;
    }
    .cca-field.cca-half:last-child {
        margin-bottom: 0;
    }
}
