/* ============================================
   WAITLIST POPUP - GLASSMORPHISM DESIGN
   Aligned with Darwin Health Color Theme
   ============================================ */

/* Modal Overlay */
.waitlist-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.waitlist-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Popup Container - Compact Card Design */
/* Popup Container - Compact Card Design */
.waitlist-popup {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    /* Deep Blue Gradient Background (Unified) */
    background: linear-gradient(135deg, #0A2468 0%, #133B9E 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.92) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.waitlist-modal-overlay.active .waitlist-popup {
    transform: scale(1) translateY(0);
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 20px;
    color: #475569;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

/* Two Column Layout - Compact Card - Swapped Columns */
.popup-content {
    display: flex;
    flex-direction: row-reverse;
    min-height: 550px;
    max-height: 85vh;
    overflow: hidden;
}

.popup-left,
.popup-right {
    flex: 1;
}

/* Left Column - Form (Now on RIGHT after swap) */
/* Left Column - Form (Now on RIGHT after swap) */
.popup-left {
    padding: 28px 32px;
    /* Glassmorphism Card Style */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    /* Make form scrollable */
    overflow-y: auto;
    max-height: calc(85vh - 32px);
}

/* Custom Scrollbar for Form Area */
.popup-left::-webkit-scrollbar {
    width: 8px;
}

.popup-left::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.popup-left::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FFB04E 0%, #F97316 100%);
    border-radius: 4px;
}

.popup-logo {
    width: 110px;
    margin-bottom: 16px;
}

.popup-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.85rem;
    font-weight: 600;
    color: #FFFFFF;
    /* White Text */
    margin: 0 0 4px 0;
    line-height: 1.1;
}

.popup-subheading {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    /* Light Text */
    margin: 0 0 20px 0;
    font-weight: 400;
    line-height: 1.3;
}

/* Form Styling - Compact */
.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFFFFF;
    /* White Label */
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    background: #F8FAFC;
    color: #0F172A;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: #1F6BFF;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(31, 107, 255, 0.1);
}

.form-input.valid {
    border-color: #37C384;
    background: rgba(55, 195, 132, 0.05);
}

.form-input.error {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Phone Input with Country Code */
.phone-input-wrapper {
    display: flex;
    gap: 12px;
}

.country-code {
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
    color: #0F172A;
    min-width: 80px;
    text-align: center;
}

.phone-input-wrapper .form-input {
    flex: 1;
}

/* Validation Icons */
.form-group {
    position: relative;
}

.validation-icon {
    position: absolute;
    right: 18px;
    top: 42px;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-group.valid .validation-icon.check,
.form-group.error .validation-icon.cross {
    opacity: 1;
}

/* Error Message */
.error-message {
    font-size: 0.875rem;
    color: #EF4444;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-group.error .error-message {
    opacity: 1;
}

/* OTP Field (Initially Hidden) */
.otp-group {
    display: none;
    animation: slideDown 0.3s ease;
}

.otp-group.active {
    display: block;
}

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

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

/* OTP Resend Container */
.otp-resend-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
}

.resend-btn {
    background: none;
    border: none;
    color: #37C384;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    font-family: inherit;
}

.resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    color: #94A3B8;
}

.resend-btn:not(:disabled):hover {
    text-decoration: underline;
    color: #2EA06D;
}

.otp-timer {
    display: none;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

/* Submit Button - Compact */
.submit-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #FFB04E 0%, #F97316 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    margin-top: 4px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Right Column - Animation */
.popup-right {
    background: transparent;
    /* Transparent to show main gradient */
    padding: 25px 35px;
    /* Reduced vertical padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decorative Background Elements */
.popup-right::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(31, 107, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.popup-right::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(55, 195, 132, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

/* Animation Title */
.animation-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 24px;
    /* Reduced bottom margin */
    z-index: 2;
}

.animation-title em {
    color: #37C384;
    font-style: italic;
}

/* Animation Container */
.animation-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 420px;
    /* Further increased height for clearance */
    /* Increased height to accommodate content better */
    z-index: 2;
}

/* Animation Steps */
.animation-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

.animation-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Step Card Styling */
.step-showcase {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.step-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: #37C384;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.step-showcase h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: #FFFFFF;
    margin: 0 0 12px 0;
}

.step-showcase p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px 0;
    /* Reduced from 32px to 16px to pull content up */
    line-height: 1.5;
}

/* Mini Visuals for Each Step */
.mini-calendar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.mini-date-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.mini-date-card.active {
    background: #37C384;
    border-color: #37C384;
}

.mini-day {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.mini-date {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
}

/* Mini Time Slots */
.mini-time-slots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.mini-time-card {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
    transition: all 0.2s ease;
}

.mini-time-card.active {
    background: #37C384;
    border-color: #37C384;
}

/* Mini Graph Container */
.mini-graph-container {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Graph Legend */
.graph-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-bar {
    width: 4px;
    height: 28px;
    border-radius: 2px;
}

.legend-bar.above {
    background: rgba(255, 255, 255, 0.15);
}

.legend-bar.in-range {
    background: #37C384;
}

.legend-bar.below {
    background: rgba(255, 255, 255, 0.15);
}

.legend-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 85px;
}

/* Mini Graph */
.mini-graph {
    width: 100%;
    height: 100px;
    position: relative;
    flex: 1;
}

.mini-graph svg {
    width: 100%;
    height: 100%;
}

/* Mini Protocol Cards */
.mini-protocol {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-protocol-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mini-icon {
    width: 32px;
    height: 32px;
    background: #37C384;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mini-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.mini-text {
    text-align: left;
    flex: 1;
}

.mini-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #FFFFFF;
    display: block;
    margin-bottom: 2px;
}

.mini-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    display: block;
}

/* Progress Dots */
.animation-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background: #37C384;
    width: 24px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .popup-content {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .popup-right {
        display: none;
    }

    .waitlist-popup {
        max-width: 500px;
        width: 92%;
        max-height: 90vh;
        overflow: hidden;
    }

    .popup-left {
        padding: 32px 24px;
        max-height: calc(90vh - 32px);
        overflow-y: auto;
        /* Firefox scrollbar */
        scrollbar-width: thin;
        scrollbar-color: #F97316 rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 640px) {
    .waitlist-modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .waitlist-popup {
        max-height: 92vh;
        overflow: hidden;
        border-radius: 20px;
    }

    .popup-left {
        padding: 20px 16px;
        margin: 10px;
        border-radius: 12px;
        max-height: calc(92vh - 20px);
        overflow-y: auto;
        /* Firefox scrollbar */
        scrollbar-width: thin;
        scrollbar-color: #F97316 rgba(255, 255, 255, 0.1);
    }

    /* Visible scrollbar for mobile */
    .popup-left::-webkit-scrollbar {
        width: 6px;
    }

    .popup-left::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 3px;
    }

    .popup-left::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #FFB04E 0%, #F97316 100%);
        border-radius: 3px;
    }

    .popup-heading {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

    .popup-subheading {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .popup-logo {
        width: 90px;
        margin-bottom: 10px;
    }

    .popup-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
    }

    .waitlist-form {
        gap: 8px;
    }

    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .phone-input-wrapper {
        flex-direction: row;
        gap: 8px;
    }

    .country-code {
        padding: 10px 10px;
        font-size: 0.8rem;
        min-width: 55px;
        border-radius: 10px;
    }

    .submit-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        margin-top: 8px;
        margin-bottom: 10px;
    }

    /* Fix validation icon position for phone input */
    #phoneGroup .validation-icon {
        top: 50px;
        right: 14px;
    }
}

/* Loading State */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   IMPORTED STYLES FROM HOME PAGE (Step 1 & 2)
   ============================================ */

/* Calendar Visual */
.calendar-visual {
    width: 90%;
    max-width: 320px;
    margin: auto;
    margin-top: 20px;
    /* Adjusted spacing for popup */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-scroll-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Date Cards */
.date-cards-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

.date-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 70px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.date-card .day {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.date-card .date {
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
}

.date-card.active {
    background-color: #37C384;
    border-color: #37C384;
    box-shadow: 0 4px 12px rgba(55, 195, 132, 0.3);
}

.date-card.active .day,
.date-card.active .date {
    color: white;
}

/* Time Pills */
.time-pills-row {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    /* Centered for popup */
}

.time-pill {
    padding: 8px 16px;
    /* Compact padding */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.time-pill.active {
    background-color: #37C384;
    border-color: #37C384;
    color: white;
}

/* Graph Visual */
.graph-visual {
    width: 95%;
    margin: auto;
    margin-top: 20px;
    height: 160px;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
    width: 90px;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 33%;
}

.range-bar {
    width: 6px;
    height: 70%;
    border-radius: 4px;
}

.range-bar.outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

.range-bar.filled {
    background: linear-gradient(to bottom, #37C384, #2EA06D);
    border: none;
    box-shadow: 0 0 8px rgba(55, 195, 132, 0.2);
}

.range-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.graph-chart-area {
    flex-grow: 1;
    position: relative;
    height: 100%;
}

.chart-zones {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.zone {
    width: 100%;
    flex: 1;
    border-top: 1px dashed rgba(55, 195, 132, 0.2);
}

.zone.bottom-zone {
    border-bottom: 1px dashed rgba(55, 195, 132, 0.2);
}

.zone.middle-zone {
    background: linear-gradient(to right, rgba(55, 195, 132, 0.05), rgba(55, 195, 132, 0.01));
}

.graph-data-layer {
    position: absolute;
    inset: 0;
    top: 10px;
    bottom: 10px;
    left: 10px;
    right: 10px;
}

.graph-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: visible;
}

.graph-line-svg path {
    stroke: #37C384;
    filter: drop-shadow(0 4px 6px rgba(55, 195, 132, 0.2));
}

.graph-point {
    width: 12px;
    height: 12px;
    background: #37C384;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    position: absolute;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
}

.p1 {
    top: 25%;
    left: 12.5%;
}

.p2 {
    top: 75%;
    left: 50%;
}

.p3 {
    top: 65%;
    left: 87.5%;
}

.p1::after {
    content: '16.7';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #FFFFFF;
}

.p2::after {
    content: '10.0';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #FFFFFF;
}

.p3::after {
    content: '12.5';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #FFFFFF;
}

/* List Visual - Protocol Cards (Step 3) */
.list-visual {
    width: 95%;
    max-width: 280px;
    margin: auto;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.protocol-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.protocol-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.protocol-icon {
    width: 40px;
    height: 40px;
    background: #37C384;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.protocol-icon svg {
    width: 20px;
    height: 20px;
}

.protocol-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
}

.protocol-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFFFFF;
}

.protocol-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}