/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --purple: #7030a0;
    --purple-light: #9b59b6;
    --purple-dark: #5b2480;
    --purple-bg: #f5f0fa;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --border: #d4d4d4;
    --border-focus: #7030a0;
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --rainbow: linear-gradient(
        90deg,
        #e74c3c 0%,
        #e67e22 14%,
        #f1c40f 28%,
        #27ae60 42%,
        #3498db 57%,
        #4b0082 71%,
        #8e44ad 100%
    );
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg-alt);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Rainbow Stripe ───────────────────────────────────────── */
.rainbow-stripe {
    height: 6px;
    background: var(--rainbow);
    flex-shrink: 0;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
}

.site-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 0.02em;
}

.site-header h1 a {
    color: inherit;
    text-decoration: none;
}

.site-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ── Main Content ─────────────────────────────────────────── */
.site-content {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--purple);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--purple-bg);
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.form-group label .required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(112, 48, 160, 0.12);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b6b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ── Radio & Checkbox Groups ──────────────────────────────── */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.radio-option input,
.checkbox-option input {
    accent-color: var(--purple);
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

/* Radio cards for membership type */
.radio-card-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 400px) {
    .radio-card-group {
        grid-template-columns: 1fr;
    }
}

.radio-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.radio-card:hover {
    border-color: var(--purple-light);
}

.radio-card.selected {
    border-color: var(--purple);
    background: var(--purple-bg);
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--purple);
}

.radio-card .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--purple);
    color: #fff;
}

.btn-primary:hover {
    background: var(--purple-dark);
}

.btn-secondary {
    background: #e8e0f0;
    color: var(--purple);
}

.btn-secondary:hover {
    background: #d6cae5;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ── Validation ───────────────────────────────────────────── */
.field-validation-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.2rem;
    display: block;
}

.input-validation-error {
    border-color: var(--error) !important;
}

.validation-summary-errors ul {
    list-style: none;
    background: #fdf0ef;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.validation-summary-errors ul li {
    color: var(--error);
    font-size: 0.9rem;
    padding: 0.15rem 0;
}

/* ── Progress Indicator ───────────────────────────────────── */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0;
    list-style: none;
    counter-reset: step;
    position: relative;
}

.progress-bar li {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    position: relative;
    counter-increment: step;
}

.progress-bar li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    margin: 0 auto 0.3rem;
    position: relative;
    z-index: 1;
}

.progress-bar li.active::before,
.progress-bar li.completed::before {
    background: var(--purple);
}

.progress-bar li.completed::before {
    content: "\2713";
}

.progress-bar li::after {
    content: '';
    position: absolute;
    top: 13px;
    left: calc(-50% + 14px);
    right: calc(50% + 14px);
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.progress-bar li:first-child::after {
    display: none;
}

.progress-bar li.active::after,
.progress-bar li.completed::after {
    background: var(--purple);
}

.progress-label {
    display: block;
    margin-top: 0.15rem;
}

@media (max-width: 500px) {
    .progress-label {
        display: none;
    }
}

/* ── Section Numbers ──────────────────────────────────────── */
.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--purple);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* ── Alerts / Info Boxes ──────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-info {
    background: #eef6fd;
    border: 1px solid #b8daff;
    color: #1a5276;
}

.alert-success {
    background: #eafaf1;
    border: 1px solid #a3d9b1;
    color: #1e7e34;
}

.alert-warning {
    background: #fef9e7;
    border: 1px solid #f7dc6f;
    color: #856404;
}

.alert-error {
    background: #fdf0ef;
    border: 1px solid #f5c6cb;
    color: var(--error);
}

/* ── Agreement Box ────────────────────────────────────────── */
.agreement-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* ── Confirmation Page ────────────────────────────────────── */
.confirmation {
    text-align: center;
    padding: 2rem 1rem;
}

.confirmation .check-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.confirmation h2 {
    color: var(--purple);
    margin-bottom: 0.5rem;
}

.confirmation p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ── Expired Page ─────────────────────────────────────────── */
.expired-page {
    text-align: center;
    padding: 3rem 1rem;
}

.expired-page .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.expired-page h2 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ── Landing Page ─────────────────────────────────────────── */
.landing-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.landing-hero h2 {
    font-size: 1.3rem;
    color: var(--purple);
    margin-bottom: 0.25rem;
}

.landing-hero p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.divider-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1.25rem 0;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 1.5rem);
    height: 1px;
    background: var(--border);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* ── Hidden by default ────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Note / Hint ──────────────────────────────────────────── */
.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-content {
        padding: 1rem 0.75rem;
    }

    .card {
        padding: 1rem;
    }
}

/* ── Test Environment Override ────────────────────────────── */
body.test-env {
    --purple: #d97706;
    --purple-light: #fbbf24;
    --purple-dark: #b45309;
    --purple-bg: #fffbeb;
    --border-focus: #d97706;
}

body.test-env .form-control:focus {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

body.test-env .btn-secondary {
    background: #fde6c4;
    color: var(--purple-dark);
}

body.test-env .btn-secondary:hover {
    background: #f9d28a;
}

.test-watermark {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'><text x='150' y='110' fill='%23d97706' fill-opacity='0.12' font-family='-apple-system,Segoe UI,Roboto,Arial,sans-serif' font-size='56' font-weight='700' text-anchor='middle' transform='rotate(-30 150 100)'>TEST</text></svg>");
    background-repeat: repeat;
}
