/**
 * SHA Membership — Registration Form Styles
 *
 * Uses SHA brand design system: Inter font, navy (#0b1a55), red (#d62828),
 * 24px card radius, 12px control radius, white/light background.
 *
 * BEM block: .sha-mem
 */

/* ─── Base ────────────────────────────────────────── */

.sha-mem {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: #1e293b;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.sha-mem *,
.sha-mem *::before,
.sha-mem *::after {
    box-sizing: border-box;
}

/* ─── Headings ────────────────────────────────────── */

.sha-mem__heading {
    font-size: 24px;
    font-weight: 700;
    color: #0b1a55;
    margin: 0 0 8px;
}

.sha-mem__subheading {
    font-size: 20px;
    font-weight: 600;
    color: #0b1a55;
    margin: 32px 0 12px;
}

.sha-mem__intro {
    color: #64748b;
    margin: 0 0 24px;
    font-size: 15px;
}

/* ─── Sections ────────────────────────────────────── */

.sha-mem__section {
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
}

.sha-mem__section--hidden {
    display: none;
}

.sha-mem__section--submit {
    background: transparent;
    box-shadow: none;
    padding: 0;
    text-align: center;
}

/* ─── Error Banner ────────────────────────────────── */

.sha-mem__errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.sha-mem__errors p {
    margin: 0 0 8px;
    color: #991b1b;
    font-weight: 600;
}

.sha-mem__errors ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #b91c1c;
    font-size: 15px;
}

.sha-mem__errors li {
    margin-bottom: 4px;
}

/* ─── Type Cards ──────────────────────────────────── */

.sha-mem__type-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.sha-mem__type-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.sha-mem__type-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sha-mem__type-card-inner {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sha-mem__type-card:hover .sha-mem__type-card-inner {
    border-color: #0b1a55;
    box-shadow: 0 4px 12px rgba(11, 26, 85, 0.10);
}

.sha-mem__type-card--selected .sha-mem__type-card-inner {
    border-color: #0b1a55;
    background: #eff2ff;
    box-shadow: 0 4px 16px rgba(11, 26, 85, 0.15);
}

.sha-mem__type-name {
    font-size: 18px;
    font-weight: 700;
    color: #0b1a55;
    margin: 0 0 8px;
}

.sha-mem__type-price {
    font-size: 28px;
    font-weight: 800;
    color: #0b1a55;
    display: block;
    margin-bottom: 8px;
}

.sha-mem__type-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.sha-mem__type-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 12px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Form Fields ─────────────────────────────────── */

.sha-mem__field {
    margin-bottom: 20px;
}

.sha-mem__field label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sha-mem__required {
    color: #d62828;
}

.sha-mem__field input[type="text"],
.sha-mem__field input[type="email"],
.sha-mem__field input[type="tel"],
.sha-mem__field input[type="date"],
.sha-mem__field select {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 16px;
    color: #1e293b;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.sha-mem__field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.sha-mem__field input:focus,
.sha-mem__field select:focus {
    outline: none;
    border-color: #0b1a55;
    box-shadow: 0 0 0 3px rgba(11, 26, 85, 0.10);
}

/* Error state */
.sha-mem__input--error,
.sha-mem__field input.sha-mem__input--error,
.sha-mem__field select.sha-mem__input--error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}

/* Valid state */
.sha-mem__input--valid,
.sha-mem__field input.sha-mem__input--valid,
.sha-mem__field select.sha-mem__input--valid {
    border-color: #16a34a;
}

.sha-mem__field-error {
    display: none;
    font-size: 14px;
    color: #dc2626;
    margin-top: 4px;
    line-height: 1.4;
}

.sha-mem__field-help {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ─── File Input ──────────────────────────────────── */

.sha-mem__file-input {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    color: #1e293b;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sha-mem__file-input:hover {
    border-color: #0b1a55;
}

.sha-mem__file-input.sha-mem__input--error {
    border-color: #dc2626 !important;
}

.sha-mem__file-input.sha-mem__input--valid {
    border-color: #16a34a;
    border-style: solid;
}

/* ─── Field Layout ────────────────────────────────── */

.sha-mem__field-row {
    display: grid;
    gap: 16px;
}

.sha-mem__field-row--half {
    grid-template-columns: 1fr 1fr;
}

.sha-mem__field-row--thirds {
    grid-template-columns: 2fr 1fr 1fr;
}

.sha-mem__field-row .sha-mem__field {
    margin-bottom: 0;
}

/* ─── Waiver ─────────────────────────────────────── */

.sha-mem__waiver-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 16px;
}

.sha-mem__waiver-scroll {
    max-height: 300px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.sha-mem__waiver-scroll h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0b1a55;
    margin: 20px 0 8px 0;
}

.sha-mem__waiver-scroll h4:first-child {
    margin-top: 0;
}

.sha-mem__waiver-scroll p {
    margin: 0 0 10px 0;
    color: #333;
}

.sha-mem__waiver-scroll ul {
    margin: 0 0 10px 0;
    padding-left: 20px;
    list-style: disc;
}

.sha-mem__waiver-scroll li {
    margin-bottom: 4px;
    color: #333;
}

/* ─── Checkbox ────────────────────────────────────── */

.sha-mem__field--checkbox {
    margin-bottom: 0;
}

.sha-mem__checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    font-weight: 400 !important;
    cursor: pointer;
}

.sha-mem__checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #0b1a55;
    cursor: pointer;
}

.sha-mem__checkbox-label a {
    color: #0b1a55;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sha-mem__checkbox-label a:hover {
    color: #1e3a8a;
}

/* ─── Submit Button ───────────────────────────────── */

.sha-mem__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    padding: 16px 40px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #d62828;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    line-height: 1.2;
}

.sha-mem__submit:hover {
    background: #b71f1f;
}

.sha-mem__submit:active {
    transform: scale(0.98);
}

.sha-mem__submit:disabled,
.sha-mem__submit--loading {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.sha-mem__submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sha-mem__submit-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sha-mem-spin 0.7s linear infinite;
}

@keyframes sha-mem-spin {
    to { transform: rotate(360deg); }
}

/* ─── Honeypot ────────────────────────────────────── */

.sha-mem__hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ─── Role Badge ──────────────────────────────────── */

.sha-mem__role-badge {
    display: inline-block;
    padding: 4px 14px;
    background: #eff2ff;
    color: #0b1a55;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.sha-mem__role-badge--small {
    padding: 2px 10px;
    font-size: 12px;
}

.sha-mem__role-badge--primary {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 10px;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════
   PROGRESS INDICATOR
   ═══════════════════════════════════════════════════ */

.sha-mem__progress {
    background: #fff;
    border-radius: 24px;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
}

.sha-mem__progress-track {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sha-mem__progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.sha-mem__progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.sha-mem__progress-number {
    font-size: 15px;
    font-weight: 700;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.sha-mem__progress-check {
    display: none;
    width: 16px;
    height: 16px;
    color: #fff;
}

.sha-mem__progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* Active step */
.sha-mem__progress-step--active .sha-mem__progress-circle {
    background: #0b1a55;
    border-color: #0b1a55;
}

.sha-mem__progress-step--active .sha-mem__progress-number {
    color: #fff;
}

.sha-mem__progress-step--active .sha-mem__progress-label {
    color: #0b1a55;
}

/* Completed step */
.sha-mem__progress-step--completed .sha-mem__progress-circle {
    background: #16a34a;
    border-color: #16a34a;
}

.sha-mem__progress-step--completed .sha-mem__progress-number {
    display: none;
}

.sha-mem__progress-step--completed .sha-mem__progress-check {
    display: block;
}

.sha-mem__progress-step--completed .sha-mem__progress-label {
    color: #16a34a;
}

/* Clickable steps */
.sha-mem__progress-step--clickable {
    cursor: pointer;
}

.sha-mem__progress-step--clickable:hover .sha-mem__progress-circle {
    transform: scale(1.1);
}

/* Connecting lines */
.sha-mem__progress-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 12px;
    margin-bottom: 28px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
    max-width: 80px;
}

.sha-mem__progress-line--completed {
    background: #16a34a;
}

/* ═══════════════════════════════════════════════════
   STEP NAVIGATION BUTTONS
   ═══════════════════════════════════════════════════ */

.sha-mem__step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.sha-mem__step-nav--review {
    margin-top: 24px;
}

.sha-mem__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    line-height: 1.2;
}

.sha-mem__btn:active {
    transform: scale(0.98);
}

.sha-mem__btn--primary {
    color: #fff;
    background: #0b1a55;
}

.sha-mem__btn--primary:hover {
    background: #1e3a8a;
}

.sha-mem__btn--secondary {
    color: #64748b;
    background: #f1f5f9;
}

.sha-mem__btn--secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

/* ═══════════════════════════════════════════════════
   ACCORDION (Family Members Step 3)
   ═══════════════════════════════════════════════════ */

.sha-mem__accordion {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.sha-mem__accordion--open {
    border-color: #0b1a55;
}

.sha-mem__accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    text-align: left;
    transition: background-color 0.2s;
}

.sha-mem__accordion-header:hover {
    background: #f1f5f9;
}

.sha-mem__accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sha-mem__accordion-member-label {
    font-weight: 700;
    color: #0b1a55;
}

.sha-mem__accordion-status {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
}

.sha-mem__accordion-status--filled {
    color: #16a34a;
    font-weight: 500;
}

.sha-mem__accordion-chevron {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sha-mem__accordion--open .sha-mem__accordion-chevron {
    transform: rotate(180deg);
}

.sha-mem__accordion-body {
    display: none;
    padding: 24px 20px;
    border-top: 1px solid #e2e8f0;
}

.sha-mem__accordion--open .sha-mem__accordion-body {
    display: block;
}

/* Family birth cert section (inside accordion or step 2) */
.sha-mem__family-birth-cert {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

/* ═══════════════════════════════════════════════════
   REVIEW CARDS (Family Step 4)
   ═══════════════════════════════════════════════════ */

.sha-mem__review-type {
    text-align: center;
    margin-bottom: 24px;
}

.sha-mem__review-type-name {
    font-size: 20px;
    font-weight: 700;
    color: #0b1a55;
}

.sha-mem__review-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.sha-mem__review-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.sha-mem__review-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.sha-mem__review-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.sha-mem__review-card-title strong {
    font-size: 16px;
    color: #0b1a55;
    width: 100%;
}

.sha-mem__review-edit {
    padding: 4px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #0b1a55;
    background: #eff2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.sha-mem__review-edit:hover {
    background: #dbeafe;
}

.sha-mem__review-card-body {
    padding: 12px 16px 16px;
}

.sha-mem__review-detail {
    font-size: 14px;
    color: #475569;
    margin-bottom: 4px;
    line-height: 1.5;
}

.sha-mem__review-detail span {
    font-weight: 600;
    color: #334155;
}

.sha-mem__review-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #eff2ff;
    border: 2px solid #c7d2fe;
    border-radius: 16px;
    margin-bottom: 24px;
}

.sha-mem__review-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #0b1a55;
}

.sha-mem__review-total-price {
    font-size: 28px;
    font-weight: 800;
    color: #0b1a55;
}

/* ─── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
    .sha-mem__section {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .sha-mem__type-cards {
        grid-template-columns: 1fr;
    }

    .sha-mem__type-card-inner {
        padding: 20px 16px;
    }

    .sha-mem__field-row--half,
    .sha-mem__field-row--thirds {
        grid-template-columns: 1fr;
    }

    .sha-mem__heading {
        font-size: 20px;
    }

    .sha-mem__submit {
        width: 100%;
    }

    /* Progress indicator responsive */
    .sha-mem__progress {
        padding: 16px;
    }

    .sha-mem__progress-circle {
        width: 32px;
        height: 32px;
    }

    .sha-mem__progress-number {
        font-size: 13px;
    }

    .sha-mem__progress-check {
        width: 14px;
        height: 14px;
    }

    .sha-mem__progress-label {
        font-size: 11px;
    }

    .sha-mem__progress-line {
        margin: 0 6px;
        margin-bottom: 24px;
        max-width: 40px;
    }

    /* Review cards single column on mobile */
    .sha-mem__review-cards {
        grid-template-columns: 1fr;
    }

    .sha-mem__review-total {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .sha-mem__review-total-price {
        font-size: 24px;
    }

    /* Step nav buttons */
    .sha-mem__step-nav {
        gap: 12px;
    }

    .sha-mem__btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .sha-mem__step-nav--review {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .sha-mem__step-nav--review .sha-mem__submit,
    .sha-mem__step-nav--review .sha-mem__btn {
        width: 100%;
    }

    /* Accordion responsive */
    .sha-mem__accordion-header {
        padding: 14px 16px;
    }

    .sha-mem__accordion-body {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .sha-mem {
        padding: 0 8px;
    }

    .sha-mem__section {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .sha-mem__type-price {
        font-size: 24px;
    }

    /* Stack progress labels below */
    .sha-mem__progress-label {
        font-size: 10px;
    }

    .sha-mem__progress-line {
        max-width: 24px;
    }
}
