:root {
    --primary: #c62828;
    --primary-dark: #b71c1c;
    --accent-blue: #2196f3;
    --accent-blue-light: #f1f8ff;
    --accent-green: #4caf50;
    --accent-green-light: #f2f9f2;
    --accent-yellow: #ff9800;
    --accent-yellow-light: #fff8eb;
    --bg-main: #ffffff;
    --bg-subtle: #f8f9fa;
    --text-main: #222;
    --text-muted: #5f6368;
    --border-color: #dadce0;
    --radius: 8px;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f3f4;
    color: var(--text-main);
    margin: 0;
    padding: 10px;
    line-height: 1.5;
    font-size: 15px;
}

.container {
    max-width: 900px;
    margin: 10px auto;
    padding: 30px 25px;
    background: var(--bg-main);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* ===== HEADINGS (COMPACT) ===== */
h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    margin: 20px 0 10px 0;
    letter-spacing: -0.02em;
}

h1 small {
    display: block;
    font-size: 0.55em;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 6px;
    margin-bottom: 5px;
    letter-spacing: 0;
}

h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 8px;
    margin-top: 35px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== INFO/WARNING BOXES (COMPACT) ===== */
.info-box,
.warning-box {
    border-radius: var(--radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.info-box {
    background-color: var(--accent-blue-light);
    border-left: 5px solid var(--accent-blue);
    color: #1a73e8;
}

.warning-box {
    background-color: var(--accent-yellow-light);
    border-left: 5px solid var(--accent-yellow);
    color: #b06000;
}

.info-box-success {
    background-color: var(--accent-green-light);
    border-left: 5px solid var(--accent-green);
    color: #1e8e3e;
}

/* Specific styling for trial training (Compact side-by-side) */
.info-box-success strong {
    color: #1e8e3e;
}

.info-box strong,
.warning-box strong {
    font-size: 1.1em;
    font-weight: 700;
}

/* ===== FORM ELEMENTS (COMPACT) ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #3c4043;
}

label small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85em;
    display: block;
    margin-top: 2px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
    background-color: #fff;
    color: var(--text-main);
}

input:hover,
select:hover {
    border-color: #9aa0a6;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

/* Invalid state (ULTRA INTENSE) */
input.invalid,
select.invalid,
label.invalid {
    border: 3px solid #c62828 !important;
    background-color: #ffebee !important;
    box-shadow: 0 0 8px rgba(198, 40, 40, 0.4) !important;
}

.invalid-feedback {
    display: none;
    color: #d93025;
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

input.invalid+.invalid-feedback,
select.invalid+.invalid-feedback {
    display: block;
}

.field-feedback {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
    display: block;
}

.field-feedback.valid {
    color: #2e7d32;
}

.field-feedback.invalid {
    color: #c62828;
}

/* ===== SPINNER FOR BUTTON ===== */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: bscSpin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    vertical-align: text-bottom;
    margin-right: 8px;
}

@keyframes bscSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== FILE UPLOAD BUTTON (MODERN) ===== */
.custom-file-upload {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 10px;
}

.custom-file-upload:hover {
    background-color: var(--primary-dark);
}

.custom-file-upload:active {
    transform: translateY(1px);
}

input[type="file"] {
    display: none;
}


/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-lang:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-lang.active {
    background: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.lang-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Larger, modern "Add Number" buttons */
.btn-upload {
    padding: 12px 24px;
    background-color: #f1f3f4;
    color: #3c4043;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-upload:hover {
    background-color: #e8eaed;
    border-color: #9aa0a6;
}



/* Ensure phone country codes have enough space but don't squeeze the input */
select[name*="_country"] {
    width: 160px !important;
    min-width: 160px !important;
}

@media (max-width: 400px) {
    select[name*="_country"] {
        width: 100px !important;
        min-width: 100px !important;
    }
}

input[type="file"]:hover {
    border-color: var(--primary);
    background-color: #fef7f6;
}

input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.25);
}

input[type="file"]::file-selector-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.2);
}

/* ===== CHECKBOX CARDS (COMPACT) ===== */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background-color: #fef7f6;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 3px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item-content strong {
    display: block;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 2px;
    font-weight: 600;
}

.checkbox-item-content small {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ===== SIGNATURE AREAS (GENEROUS & MODERN) ===== */
.signature-area {
    margin: 30px 0;
    padding: 24px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.signature-area:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

canvas {
    border: 2px dashed #bdc1c6;
    background-color: #ffffff;
    border-radius: 10px;
    width: 100%;
    height: 220px;
    /* Increased base height (was 180) */
    cursor: crosshair;
    touch-action: none;
    transition: border-color 0.2s;
}

canvas:hover {
    border-color: var(--primary);
}

@media (max-width: 768px) {
    canvas {
        height: 150px;
        /* Half height as requested (was 300px) */
    }

    .signature-area {
        padding: 16px;
        margin: 20px 0;
    }
}

.btn-clear {
    background: #e8eaed;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3c4043;
    margin-top: 10px;
    cursor: pointer;
}

.btn-clear:hover {
    background: #dadce0;
}

/* ===== BUTTONS (COMPACT) ===== */
.btn-submit {
    background-color: var(--primary);
    color: #fff;
    padding: 16px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    width: 100%;
    margin-top: 35px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(198, 40, 40, 0.2);
    /* Mobile Touch Optimization */
    -webkit-tap-highlight-color: rgba(198, 40, 40, 0.3);
    touch-action: manipulation;
    /* Prevents double-tap zoom delay */
    user-select: none;
    -webkit-user-select: none;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(198, 40, 40, 0.3);
}

/* Critical: Active state for mobile touch feedback */
.btn-submit:active {
    background-color: var(--primary-dark);
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(198, 40, 40, 0.4);
}

.btn-reset {
    background-color: var(--primary);
    color: #fff;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    float: right;
    margin-bottom: 15px;
}

.btn-reset:hover {
    background-color: var(--primary-dark);
}

/* ===== PROGRESS PILLS (DYNAMIC) ===== */
.section-progress {
    background-color: #e8eaed;
    color: #5f6368;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-progress.completed {
    background-color: #1e8e3e;
    color: white;
}

.section-progress.active {
    background-color: #f9ab00;
    color: white;
}

/* ===== RESPONSIVE REFINEMENTS ===== */

/* === RESPONSIVE REFINEMENTS (Advanced) === */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        margin: 5px;
        border-radius: 8px;
        /* Slightly rounded on mobile */
        width: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
        /* Force single column */
        gap: 20px;
    }

    /* Make touch targets bigger */
    input,
    select,
    .btn-submit,
    .btn-upload,
    .checkbox-item {
        min-height: 48px;
        /* Recommended touch target size */
    }

    .btn-lang {
        padding: 8px 16px;
        /* Larger hit area */
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-top: 10px;
    }

    h3 {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .section-progress {
        align-self: flex-start;
        margin-top: 5px;
    }

    .lang-switcher {
        justify-content: center;
        /* Center flags on mobile */
        margin-bottom: 25px;
        width: 100%;
    }

    .info-box,
    .warning-box {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Better spacing for checklist items */
    .checkbox-item {
        padding: 15px;
    }

    /* Prevent horizontal scroll on canvas */
    canvas {
        max-width: 100%;
    }
}

/* Fix for side-by-side boxes on small desktop/tablet */
.info-row {
    margin-bottom: 10px;
}

@media (min-width: 600px) {
    .info-row {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
    }

    .info-row>.info-box {
        flex: 1;
        margin-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* === LANGUAGE SWITCHER === */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-lang {
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #ddd;
}

.btn-lang:hover {
    background: #e0e0e0;
}

.btn-lang.active {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

/* Email no-break */
.email-no-break {
    white-space: nowrap;
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

.btn-reset-top {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    color: #5f6368;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-top:hover {
    background: #fdeaea;
    color: var(--primary);
    border-color: var(--primary);
}

.prepare-list {
    margin: 8px 0 0 20px;
    padding: 0;
}

.prepare-list li {
    margin-bottom: 4px;
}

/* === GRID SYSTEM (Standard 2-Column) === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Group fields if they are single but should align with grid */
.form-group.form-col-1 {
    grid-column: span 1;
}

.form-group.form-col-2,
.form-group.form-col-full {
    grid-column: 1 / -1;
}

/* === RESPONSIVE REFINEMENTS === */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        margin: 0;
        border-radius: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    .form-group.form-col-1,
    .form-group.form-col-2,
    .form-group.form-col-full {
        grid-column: 1 / -1;
    }
}

/* Full-Width Child Name Hint Box (Red/Urgent) */
.child-name-hint-box {
    grid-column: 1 / -1;
    background-color: #fdecea;
    /* Light red background */
    border: 1px solid #f5c6cb;
    border-left: 5px solid var(--primary);
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #c62828;
    margin-bottom: 20px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== FORM HEADER ===== */
.form-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    gap: 15px;
    flex-wrap: wrap;
}

.form-title {
    margin: 0;
    border: none !important;
    padding: 0 !important;
    flex: 1;
    min-width: 200px;
}

/* ===== RESET BUTTON ===== */
.btn-reset-top {
    background: #fff;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-start;
}

.btn-reset-top:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-subtle);
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 600px) {
    .btn-reset-top {
        font-size: 0.75rem;
        padding: 5px 10px;
        order: 2;
    }

    .form-title {
        font-size: 1.4rem !important;
        order: 1;
    }

    .form-title small {
        font-size: 0.75rem;
    }

    .container {
        padding: 20px 15px;
    }
}



/* ===== MODERN PREMIUM SHAKE (REFINED) ===== */
.shake-modern {
    animation: bscShakeModern 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    z-index: 10;
    /* Ensure it's above other elements during shake */
}

@keyframes bscShakeModern {
    0% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-10px) rotate(-1.5deg);
        box-shadow: 0 0 25px rgba(198, 40, 40, 0.5);
        border-color: #c62828;
    }

    20% {
        transform: translateX(9px) rotate(1.2deg);
        box-shadow: 0 0 20px rgba(198, 40, 40, 0.4);
    }

    30% {
        transform: translateX(-8px) rotate(-1deg);
        box-shadow: 0 0 15px rgba(198, 40, 40, 0.3);
    }

    40% {
        transform: translateX(7px) rotate(0.8deg);
    }

    50% {
        transform: translateX(-5px) rotate(-0.5deg);
    }

    60% {
        transform: translateX(4px) rotate(0.3deg);
    }

    70% {
        transform: translateX(-2px) rotate(-0.2deg);
    }

    80% {
        transform: translateX(1px) rotate(0.1deg);
    }

    90% {
        transform: translateX(-1px);
    }

    100% {
        transform: translateX(0);
    }
}

/* ===== ADDRESS AUTOCOMPLETE ===== */
.address-autocomplete-results {
    position: absolute !important;
    background: white !important;
    border: 1px solid #dadce0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    margin-top: 5px !important;
}

/* Pulse Animation for Duplicate Warning */
@keyframes blinkSoft {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.blink-soft {
    animation: blinkSoft 2s infinite;
}

.address-autocomplete-results div {
    padding: 12px 15px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #eee !important;
    transition: background 0.2s;
    color: #333 !important;
}

.address-autocomplete-results div:hover {
    background: #f1f8ff !important;
    color: #c62828 !important;
}

/* ===== TOAST NOTIFICATIONS ===== */
.bsc-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
    max-width: 300px;
    border-left: 4px solid var(--accent-green);
}

.bsc-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== EXTRACTED UTILITIES (Cleaned from HTML) ===== */
.divider-primary {
    height: 3px;
    background: var(--primary);
    margin-bottom: 20px;
}

.hidden-box {
    margin-top: 10px;
}

.notice-box-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.indent-section {
    padding-left: 25px;
    border-left: 2px solid #EEE;
    margin-bottom: 20px;
}

.creditor-info-box {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #007bff;
}

.error-text-health {
    color: #d93025;
    font-size: 0.9rem;
    margin-top: 10px;
    font-weight: 600;
}

.error-box-main {
    display: none;
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    border: 1px solid #ef9a9a;
    white-space: pre-wrap;
}

.footer-marker {
    margin-top: 40px;
    text-align: center;
    color: #9aa0a6;
    font-size: 0.85rem;
    border-top: 1px solid #e8eaed;
    padding-top: 20px;
}

/* Modal Styling */
.modal-overlay {
    display: none;
    /* Wird von JS auf 'flex' gesetzt */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    padding: 100px 20px 20px 20px;
    /* Oben 100px, sonst 20px */
    overflow-y: auto;
    /* Ermöglicht Scrollen, wenn nötig */
    /* KRITISCH: Diese Eigenschaften greifen, wenn JS display='flex' setzt */
    align-items: flex-start;
    /* Verhindert Stretching nach unten! */
    justify-content: center;
    /* Zentriert horizontal */
}

.modal-content-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    /* Verhindert Vollbreite auf Mobile */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    /* Auto-Höhe, minimiert Vertikale Ausdehnung */
    flex-shrink: 0;
    /* Verhindert Stretching durch Flexbox */
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-title {
    margin-bottom: 10px;
    color: #333;
}

.modal-desc {
    color: #666;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-modal-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.btn-modal-confirm {
    padding: 10px 20px;
    border: none;
    background: #d93025;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== FOOTER MARKER ===== */
.footer-marker {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 25px;
    padding-top: 15px;
    padding-bottom: 10px;
    border-top: 1px solid #eee;
    line-height: 1.6;
}

/* ===== SPORT-SPECIFIC VISIBILITY ===== */
/* Default: Judo is visible, Tai-Chi is hidden */
.judo-only {
    display: block;
}

/* Fix for Flex Items (CheckboxItem) */
.checkbox-item.judo-only {
    display: flex !important;
}

.taichi-only {
    display: none;
}

/* Tai-Chi Active State */
body.taichi .judo-only {
    display: none !important;
}

body.taichi .taichi-only {
    display: block !important;
}

body.taichi .checkbox-item.taichi-only {
    display: flex !important;
}

/* Explicit Judo State (same as default, but ensures override) */
body.judo .taichi-only {
    display: none !important;
}

body.judo .judo-only {
    display: block !important;
}

body.judo .checkbox-item.judo-only {
    display: flex !important;
}

/* Checkbox Error Message Placement: Force below box */
.checkbox-item {
    flex-wrap: wrap;
}

.checkbox-item .field-feedback {
    flex-basis: 100%;
    width: 100%;
    margin-top: 5px;
    margin-left: 34px;
    /* Align with text (20px box + 14px gap) */
    display: block;
}

/* Ensure content stays next to checkbox */
.checkbox-item-content {
    flex: 1 1 0px;
    min-width: 0;
}

/* Indentation for nested sections */
/* Indentation for nested sections */
.indent-section {
    margin-left: 25px;
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.indent-section.hidden {
    display: none !important;
}

/* ===== PREMIUM ANIMATIONS ===== */
.shake-modern {
    animation: shake-modern-anim 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-modern-anim {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

#final-footer-marker {
    height: 1px;
    width: 100%;
    clear: both;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modal-pop 0.3s ease-out;
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    margin-top: 0;
    color: #d93025;
}

.modal-desc {
    margin: 15px 0 25px;
    color: #555;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-modal-cancel {
    padding: 10px 20px;
    border: 1px solid #ccc;
    background: #eee;
    border-radius: 4px;
    cursor: pointer;
}

.btn-modal-confirm {
    padding: 10px 20px;
    border: none;
    background: #d93025;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== SUCCESS SCREEN ===== */
.success-screen {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.success-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-size: 60px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-content h2 {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.success-content p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.member-number {
    font-size: 1.3rem !important;
    margin: 25px 0 !important;
    padding: 20px;
    background: var(--accent-blue-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.member-number strong {
    color: var(--accent-blue);
    font-size: 1.4rem;
    font-family: 'Courier New', monospace;
}

.btn-home {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 40px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
}

.btn-home:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
}

/* Mobile optimization for success screen */
@media (max-width: 768px) {
    .success-screen {
        padding: 40px 15px;
        min-height: 400px;
    }

    .success-content {
        padding: 30px 20px;
    }

    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 48px;
    }

    .success-content h2 {
        font-size: 22px;
    }

    .member-number {
        font-size: 1.1rem !important;
        padding: 15px;
    }

    .member-number strong {
        font-size: 1.2rem;
    }
}