/* Modal Overlay & Container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    z-index: 99999;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 20px;
    opacity: 1;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.step-content.hidden {
    display: none !important;
}

/* Modal Wrapper */
.modal-container {
    width: 90%;
    max-width: 750px;
    position: relative;
    max-height: 90vh;
    /* Allow slightly more, relying on internal scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: max-width 0.4s ease;
}

.step-2-active .modal-container {
    max-width: 1100px !important;
}

/* Stepper - Compact */
.modal-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    /* Aggressively reduced */
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 0;
    width: 100%;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: #888;
    position: relative;
    width: 100px;
    font-size: 0.7rem;
}

.step.active {
    color: #333;
    font-weight: 600;
}

.step-circle {
    width: 24px;
    /* Smaller */
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
    z-index: 2;
}

.step.active .step-circle {
    background: #0b0f19;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.step-line {
    width: 80px;
    height: 2px;
    background: #ddd;
    margin-bottom: 20px;
    /* Align with circle center */
    position: relative;
    z-index: 1;
}

/* Content Area */
.modal-content-area {
    width: 100%;
    position: relative;
}

/* White Card Style - Compact Padding */
.white-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    /* Reduced padding */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    width: 100%;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #bbb;
    line-height: 1;
    z-index: 20;
}

.modal-close-btn:hover {
    color: #333;
}

.step-2-active .modal-close-btn {
    right: 0;
    top: -35px;
    color: #fff;
}

/* Step 1 Specific Inner Styles - Compact Headers */
.step-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.step-header-container h2 {
    font-size: 1.4rem;
    margin: 0;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.2rem;
}

.header-icon-right {
    opacity: 0.7;
    margin-top: 5px;
}

/* Inputs styling */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    color: #aaa;
}

.form-group label {
    font-size: 0.75rem;
    /* Smaller label */
    color: #555;
    margin-bottom: 0.3rem;
    display: block;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    background: #f8f9fa;
    border: 1px solid transparent;
    padding: 0.7rem 1rem 0.7rem 2.4rem;
    /* Lower height */
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:hover {
    border-color: rgba(31,122,74,0.35);
    box-shadow: 0 2px 8px rgba(31,122,74,0.1);
}

.form-group input:focus {
    background: #fff;
    border-color: rgba(31,122,74,0.45);
    box-shadow: 0 2px 8px rgba(31,122,74,0.15);
    outline: none;
}

.form-group {
    margin-bottom: 0.8rem;
    /* Very compact */
}

/* Client Selector Pills */
.client-type-selector {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card span {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 38px;
    /* Shorter pills */
    border: 1px solid #eee;
    border-radius: 8px;
    font-weight: 500;
    color: #888;
    background: #fff;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.radio-card input:checked+span {
    border-color: #0b1019;
    color: #0b1019;
    background: #fbfbfb;
    border-width: 1px;
    font-weight: 600;
}

/* Secure Info Footer */
.secure-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    font-size: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    /* Reduce bottom margin */
}

/* Buttons */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.btn-step-action {
    flex: 1;
    padding: 0.7rem;
    /* Thinner buttons */
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-outline {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.btn-dark {
    background: #0b0f19;
    border: 1px solid #0b0f19;
    color: #fff;
}

.btn-dark:hover {
    background: #222;
}

/* Step 2 Split Layout - Compact Form */
.payment-split-layout {
    display: flex;
    gap: 2.5rem;
    /* Increased gap */
    justify-content: space-between;
    width: 100%;
}

.payment-visuals {
    flex: 0 0 380px;
    /* Widened width */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Credit Card Visual */
.credit-card-preview {
    background: linear-gradient(135deg, #515865 0%, #30353e 100%);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    position: relative;
    height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Courier New', Courier, monospace;
}

.card-chip {
    width: 40px;
    height: 30px;
    background: #e0e0e0;
    border-radius: 6px;
    opacity: 0.9;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, #aaa 2px, #aaa 4px);
}

.card-wifi {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    opacity: 0.8;
}

.card-number-display {
    font-size: 1.3rem;
    letter-spacing: 2px;
    margin-top: 0.5rem;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    word-spacing: 0.2rem;
}

.card-details-display {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0px;
    gap: 0.5rem;
}

/* Logo removed styling */
.card-logo {
    display: none;
}

/* Order Summary Box */
.order-summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.summary-row.total-highlight {
    margin-top: 0.8rem;
    margin-bottom: 0;
    font-weight: 700;
    color: #111;
    font-size: 1.1rem;
    align-items: center;
}

.summary-total-display.main {
    font-size: 1.4rem;
}

.summary-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 1rem 0;
}

/* Floating Back Button */
.btn-back-simple {
    background: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Distinct shadow */
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-back-simple:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Right Column: Form */
.payment-form-container {
    flex: 1;
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.payment-header h3 {
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
}

.payment-header p {
    font-size: 0.9rem;
    color: #888;
}

/* Black button specific */
.btn-black {
    background: #000;
    color: #fff;
    font-weight: 600;
    padding: 1rem;
    border-radius: 12px;
    letter-spacing: 0.5px;
    font-size: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.terms-text {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
}

/* Status Icons */
.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.success-icon {
    background-color: #22c55e;
}

.error-icon {
    background-color: #EF4444;
}

/* Responsive */
@media (max-width: 768px) {
    .payment-split-layout {
        flex-direction: column;
    }

    .payment-visuals {
        flex: auto;
        width: 100%;
    }

    .step-2-active .modal-container {
        max-width: 95%;
    }

    .white-card {
        padding: 1.2rem;
    }

    .modal-container {
        width: 95%;
        padding: 0;
    }

    .modal-actions {
        flex-direction: row;
    }
}