/* ============================================
   Membership Enrollment Form - Styles
   ============================================ */

/* ==========================================
               PAGE SCROLL FIX
   Override body overflow:hidden to enable normal scrolling
   on the Membership enrollment form page
               ========================================== */
body.dark-scheme {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
}

html {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

/* ==========================================
               ENROLLMENT WARNING STYLES
               ========================================== */
#enrollment-warning {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    color: #856404 !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
    position: relative;
    z-index: 100;
}

/* Class-based visibility control (more reliable than inline styles) */
#enrollment-warning.enrollment-warning-hidden {
    display: none !important;
}

#enrollment-warning.enrollment-warning-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#enrollment-warning strong {
    color: #664d03 !important;
}

#enrollment-warning a {
    color: #856404 !important;
    font-weight: bold;
    text-decoration: underline;
}

/* ==========================================
               ENHANCED STEP INDICATOR STYLES
               ========================================== */
.step-container {
    padding: 0 10px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    position: relative;
}

    .step-indicator.active,
    .step-indicator.completed {
        opacity: 1;
    }

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(200, 155, 60, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.step-indicator.active .step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(200, 155, 60, 0.4);
    transform: scale(1.1);
}

.step-indicator.completed .step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.step-number {
    font-size: 18px;
    color: #ffffff;
}

.step-indicator.completed .step-number {
    display: none;
}

.step-check {
    display: none;
    font-size: 24px;
    color: #ffffff;
}

.step-indicator.completed .step-check {
    display: block;
}

.step-line {
    flex: 1 1 auto;
    height: 3px;
    background: rgba(200, 155, 60, 0.2);
    margin: 0 10px;
    margin-top: -25px;
    min-width: 30px;
    transition: all 0.3s ease;
}

.step-indicator.completed ~ .step-line,
.step-indicator.active ~ .step-line {
    background: var(--color-primary);
}

.step-label {
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
    font-weight: 500;
}

/* Mobile responsive step indicator - two rows */
@media (max-width: 576px) {
    .step-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 20px;
        padding: 0;
    }

    .step-indicator {
        width: auto;
        margin-bottom: 0;
    }

    .step-line {
        display: none;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        margin-bottom: 4px;
    }

    .step-number {
        font-size: 14px;
    }

    .step-check {
        font-size: 18px;
    }

    .step-label {
        font-size: 11px;
    }

    .step-indicator.active .step-circle {
        transform: scale(1.1);
    }
}

/* ==========================================
               FORM STEP TRANSITIONS
               ========================================== */
.form-step {
    display: none;
    animation-duration: 0.4s;
    animation-fill-mode: both;
}

    .form-step.active {
        display: block;
    }

.fade-in {
    animation-name: fadeInSlide;
}

.fade-out {
    animation-name: fadeOutSlide;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutSlide {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* ==========================================
               STEP HEADER STYLES
               ========================================== */
.step-header {
    border-bottom: 2px solid rgba(200, 155, 60, 0.2);
    padding-bottom: 15px;
}

    .step-header h4 {
        color: var(--color-primary);
        margin-bottom: 5px;
    }

/* ==========================================
               FORM STYLES
               ========================================== */
.form-control-lg {
    padding: 12px 16px;
    font-size: 16px;
}

.form-label h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    display: inline-block;
}

.form-control {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transition: all 0.3s ease;
}

    .form-control:focus {
        background-color: rgba(0, 0, 0, 0.4);
        border-color: var(--color-primary);
        box-shadow: 0 0 0 0.2rem rgba(200, 155, 60, 0.15);
        color: #ffffff;
    }

    .form-control::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

/* ==========================================
               DOCUMENT VIEWER STYLES
               ========================================== */
.document-viewer {
    border: 1px solid rgba(200, 155, 60, 0.3);
    transition: all 0.3s ease;
}

    .document-viewer:hover {
        border-color: var(--color-primary);
        box-shadow: 0 0 15px rgba(200, 155, 60, 0.2);
    }

.document-content {
    font-size: 13px;
    line-height: 1.6;
}

    .document-content p {
        margin-bottom: 12px;
    }

/* ==========================================
               SIGNATURE SECTION
               ========================================== */
.signature-section {
    border: 2px dashed var(--color-primary);
    background: rgba(200, 155, 60, 0.05);
}

/* ==========================================
               VALIDATION STYLES
               ========================================== */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

.text-danger {
    color: #ff6b6b !important;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ==========================================
               ORDER SUMMARY STYLES
               ========================================== */
.order-summary {
    border: 2px solid rgba(200, 155, 60, 0.4);
    background: rgba(200, 155, 60, 0.05) !important;
}

.order-summary h5 {
    color: var(--color-primary);
    border-bottom: 1px solid rgba(200, 155, 60, 0.2);
    padding-bottom: 12px;
}

.order-summary .id-color {
    color: var(--color-primary) !important;
}

/* ==========================================
               SQUARE PAYMENT FORM
               ========================================== */
#payment-form {
    overflow: visible;
    width: 100%;
}

#card-container {
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

/* Ensure Square iframe doesn't overflow and allow scroll passthrough */
#card-container iframe,
#card-container > div {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Fix scroll trapping in Square iframe - allow touch/wheel scroll to pass through */
#card-container iframe {
    pointer-events: auto;
    touch-action: pan-y pinch-zoom;
}

/* When not focused on card inputs, ensure page can scroll */
#payment-form:not(:focus-within) {
    pointer-events: auto;
}

/* On smaller screens, give more room for card fields */
@media (max-width: 576px) {
    #payment-form {
        padding: 12px !important;
    }
}

/* ==========================================
               DROPDOWN FIX
               ========================================== */
select.form-control option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 8px 12px;
}

    select.form-control option:hover {
        background-color: var(--color-primary, #c89b3c) !important;
        color: #000000 !important;
    }

    select.form-control option:checked {
        background-color: var(--color-primary, #c89b3c) !important;
        color: #000000 !important;
        font-weight: bold;
    }

    select.form-control option:disabled {
        color: #666666 !important;
        font-style: italic;
    }

/* ==========================================
               BUTTON ENHANCEMENTS
               ========================================== */
.btn-lg {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* ==========================================
               RESPONSIVE ADJUSTMENTS
               ========================================== */
@media (max-width: 768px) {
    .step-circle {
        width: 40px;
        height: 40px;
    }

    .step-number {
        font-size: 16px;
    }

    .step-check {
        font-size: 20px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-line {
        min-width: 15px;
        margin: 0 5px;
    }

    .bg-dark-3 {
        padding: 20px !important;
    }

    /* Document viewer - stack header on mobile */
    .document-viewer .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .document-viewer .d-flex.justify-content-between h5 {
        font-size: 16px;
        margin-bottom: 0;
    }

    .document-viewer .d-flex.justify-content-between .btn-main {
        width: 100%;
        text-align: center;
    }

    /* Review section - stack content and Edit button on mobile */
    .review-section .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .review-section .d-flex.justify-content-between > div:first-child {
        margin-bottom: 10px;
    }

    .review-section .d-flex.justify-content-between .btn-main {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .review-section .d-flex.justify-content-between .btn-main span {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Fix text overflow in review and order summary sections */
    .review-section p,
    .review-section span,
    .order-summary span,
    .order-summary .summary-content span {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }

    #review-plan-name,
    #review-email,
    #summary-plan-name {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ==========================================
               ENROLLMENT TYPE CARDS
               ========================================== */
.enrollment-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.enrollment-type-card {
    flex: 1 1 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .enrollment-type-card:hover {
        border-color: rgba(200, 155, 60, 0.5);
        background: rgba(200, 155, 60, 0.1);
    }

    .enrollment-type-card input[type="radio"] {
        position: absolute;
        opacity: 0;
    }

    .enrollment-type-card input[type="radio"]:checked + label {
        color: var(--color-primary);
    }

    .enrollment-type-card:has(input:checked) {
        border-color: var(--color-primary);
        background: rgba(200, 155, 60, 0.15);
        box-shadow: 0 0 15px rgba(200, 155, 60, 0.2);
    }

    .enrollment-type-card label {
        cursor: pointer;
        display: block;
        margin: 0;
        padding: 0;
    }

    .enrollment-type-card i {
        font-size: 24px;
        margin-bottom: 5px;
    }

.participant-section,
.account-holder-section {
    border-left: 3px solid var(--color-primary);
    padding-left: 20px;
}

/* ==========================================
               REVIEW SECTION STYLES
               ========================================== */
.enrollment-review .review-section {
    transition: all 0.3s ease;
}

    .enrollment-review .review-section:hover {
        background: rgba(200, 155, 60, 0.1) !important;
    }

    .enrollment-review .review-section h6 {
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .enrollment-review .review-section p {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .enrollment-review .review-section strong {
        opacity: 0.7;
    }

/* ==========================================
               HOVER EFFECTS
               ========================================== */
.hover-scale {
    transition: transform 0.3s ease;
}

    .hover-scale:hover {
        transform: translateY(-5px);
    }
