/* CSS Variables */
:root {
    --violet-50: #EDECFD;
    --violet-200: #B3B2F9;
    --violet-500: #3B38EB;
    --grey-50: #F1F4F8;
    --grey-100: #E2E4EA;
    --grey-200: #C3CAD5;
    --grey-500: #6D7D98;
    --grey-600: #56647B;
    --grey-900: #16181D;
    --grey-950: #0B0C0F;
    --success-50: #DCF2EA;
    --success-500: #1CC688;
    --brand-dark: #04033E;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, Roboto, Helvetica, sans-serif;
    line-height: 1.5;
    color: var(--grey-950);
    background-color: white;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Header Styles */
.header {
    width: 100%;
    background-color: white;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 13px;
}

.logo-icon {
    position: relative;
    width: 45.518px;
    height: 23.268px;
}

.logo-bg {
    position: absolute;
    left: 8px;
    top: 5px;
    width: 38px;
    height: 18px;
}

.logo-main {
    position: absolute;
    left: 0;
    top: 0;
    width: 42px;
    height: 18px;
}

.logo-text {
    font-family: 'Gabarito', sans-serif;
    font-size: 25px;
    font-weight: 400;
}

.logo-make { color: var(--brand-dark); }
.logo-debt { color: var(--violet-500); }
.logo-gone { color: var(--brand-dark); }

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Step Container */
.step-container {
    display: block;
}

/* Progress Section */
.progress-section {
    background-color: var(--violet-50);
    padding: 12px 16px;
}

.progress-content {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.back-button {
    width: 44px;
    height: 44px;
    border-radius: 40px;
    background-color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.back-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.progress-bar {
    flex: 1;
    position: relative;
    height: 10px;
}
.progress-bg {
    width: 100%;
    height: 10px;
    background-color: white;
    border-radius: 5px;
}
.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 10px;
    background-color: var(--violet-500);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Question Section */
.question-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 1. Збільшено відступ від прогрес бару до заголовку */
    padding: 80px 16px 64px;
}
/* 6, 7. Додаткові класи для зменшення відступів на останніх кроках */
.phone-step-section, .ssn-step-section {
    padding-top: 24px;
}


.question-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.question-title h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 500;
    text-align: center;
    color: var(--grey-950);
    line-height: 1.2;
    margin-bottom: 0;
}
.question-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    color: var(--grey-600);
    margin-top: 20px;
    max-width: 419px;
}

.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.input-dropdown {
    width: 100%;
    height: 60px;
    padding: 22px 14px 22px 24px;
    border: 1px solid var(--grey-100);
    border-radius: 10px;
    background-color: var(--grey-50);
    box-shadow: 0 4px 32.2px rgba(212, 217, 232, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative; /* Додано для позиціонування випадаючого списку */
}

.input-dropdown span {
    color: var(--grey-500);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
}
.input-dropdown.selected span {
    color: var(--grey-900);
}

.next-button, .submit-button {
    width: 100%;
    height: 60px;
    border-radius: 10px;
    background-color: var(--grey-200);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    transition: background-color 0.2s ease;
}

.next-button span, .submit-button span {
    color: white;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.next-button:not(:disabled), .submit-button:not(:disabled) {
    background-color: var(--violet-500);
    cursor: pointer;
}

.next-button:not(:disabled):hover, .submit-button:not(:disabled):hover {
    background-color: #2F2BCC;
}

/* Payment Options (Radio Buttons) */
.payment-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 2. Ховаємо стандартну радіо-кнопку */
.payment-radio-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.payment-option {
    width: 100%;
    height: 72px;
    border: none;
    border-radius: 10px;
    background-color: var(--grey-50);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.payment-option span {
    color: var(--violet-500);
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.4px;
}

.payment-option:hover {
    background-color: var(--violet-50);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 56, 235, 0.1);
}

/* 2. Стилі для вибраного стану через :checked */
.payment-radio-hidden:checked + .payment-option {
    background-color: var(--violet-500);
    box-shadow: 0 4px 12px rgba(59, 56, 235, 0.2);
}

.payment-radio-hidden:checked + .payment-option span {
    color: white;
    font-weight: 600;
}

/* Text Input Fields */
.text-input {
    width: 100%;
    position: relative;
}

.text-input input {
    width: 100%;
    height: 60px;
    padding: 22px 14px 22px 24px;
    border: 1px solid var(--grey-100);
    border-radius: 10px;
    background-color: var(--grey-50);
    box-shadow: 0 4px 32.2px rgba(212, 217, 232, 0.25);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--grey-900);
    outline: none;
    transition: all 0.2s ease;
}

.text-input input::placeholder {
    color: var(--grey-500);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
}

.text-input input:focus {
    border-color: var(--violet-500);
    box-shadow: 0 4px 32.2px rgba(59, 56, 235, 0.15);
    background-color: white;
}
.text-input input:valid:not(:placeholder-shown) {
    border-color: var(--success-500);
    background-color: white;
}
.text-input input.error {
    border-color: #FF6B6B;
    background-color: #FFF5F5;
}
.text-input input.error::placeholder {
    color: #FF6B6B;
}

/* Date Input Fields */
.date-inputs {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.date-month-row { display: contents; }
.date-dropdown {
    height: 60px;
    padding: 22px 8px 22px 14px;
    border: 1px solid var(--grey-100);
    border-radius: 10px;
    background-color: var(--grey-50);
    box-shadow: 0 4px 32.2px rgba(212, 217, 232, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.date-dropdown:first-child { width: 123px; flex-shrink: 0; }
.date-dropdown.month-dropdown { flex: 1; }
.date-dropdown.year-dropdown { width: 123px; flex-shrink: 0; }
.date-dropdown span {
    color: var(--grey-500);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
}
.date-dropdown.selected span { color: var(--grey-900); }
.date-dropdown:hover { background-color: var(--violet-50); border-color: var(--violet-500); }
.date-dropdown:focus { outline: none; border-color: var(--violet-500); box-shadow: 0 4px 32.2px rgba(59, 56, 235, 0.15); }

.security-notice {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    background-color: var(--success-50);
    display: flex;
    align-items: center;
    gap: 8px;
}
.shield-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.security-notice p { flex: 1; font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--grey-900); }

/* Footer */
.footer { background-color: white; padding: 44px 0; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 44px; }
.footer-disclaimer { width: 100%; padding: 0 100px; }
.footer-divider { width: 100%; border-top: 1px solid #DADADA; margin-bottom: 48px; }
.disclaimer-text { text-align: center; }
.disclaimer-text p { font-family: 'Nunito Sans', sans-serif; font-size: 14px; font-weight: 300; color: #7A7A7A; line-height: 1.4; max-width: 100%; }
.disclaimer-text a { color: #7A7A7A; text-decoration: underline; }
.disclaimer-text a:hover { text-decoration: none; }

/* Dropdown Styles */
.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--grey-100);
    border-radius: 10px;
    box-shadow: 0 4px 32.2px rgba(212, 217, 232, 0.25);
    z-index: 1000;
    margin-top: 4px;
    max-height: 250px; /* Збільшено висоту для кращого скролу */
    overflow-y: auto;
}
.dropdown-option {
    padding: 16px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: var(--grey-900);
    cursor: pointer;
    border-bottom: 1px solid var(--grey-100);
    transition: background-color 0.2s ease;
}
.dropdown-option:last-child { border-bottom: none; }
.dropdown-option:hover { background-color: var(--violet-50); }
.dropdown-option:first-child { border-radius: 10px 10px 0 0; }
.dropdown-option:last-child { border-radius: 0 0 10px 10px; }


/* Loader Styles */
.loader-section { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px; min-height: 400px; }
.loader-container { display: flex; flex-direction: column; align-items: center; gap: 100px; }
.loader-animation {
    width: 150px;
    height: 150px;
    position: relative;
    /* 5. Додано анімацію обертання */
    animation: loader-rotate 2s linear infinite;
}
.loader-dots { width: 150px; height: 150px; position: relative; }
.loader-dot { position: absolute; background-color: var(--violet-500); border-radius: 50%; animation: loader-fade 1.2s ease-in-out infinite; }
.loader-dot:nth-child(1) { width: 8px; height: 8px; top: 62px; left: 47px; animation-delay: 0s; }
.loader-dot:nth-child(2) { width: 6px; height: 6px; top: 79px; left: 46px; animation-delay: 0.15s; }
.loader-dot:nth-child(3) { width: 5px; height: 5px; top: 93px; left: 51px; animation-delay: 0.3s; }
.loader-dot:nth-child(4) { width: 3px; height: 3px; top: 103px; left: 63px; animation-delay: 0.45s; }
.loader-dot:nth-child(5) { width: 2px; height: 2px; top: 105px; left: 78px; animation-delay: 0.6s; }

/* 5. Додано keyframes для обертання */
@keyframes loader-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes loader-fade { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
.loader-text h2 { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 500; color: var(--grey-950); text-align: center; margin: 0; line-height: 1.4; }


/* Congratulations & Phone Section */
.congratulations-section { width: 100%; background-color: #E5F6F0; padding: 32px 0; /* 6. Зменшено нижній відступ */ margin-bottom: 24px; }
.congratulations-container { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 420px; margin: 0 auto; padding: 0 16px; }
.check-icon { width: 32px; height: 32px; }
.congratulations-title { font-size: 28px; font-weight: 500; text-align: center; margin: 0; line-height: 1.2; }
.congratulations-subtitle { font-size: 16px; font-weight: 400; text-align: center; margin: 0; line-height: 1.4; }

.phone-section { width: 100%; display: flex; justify-content: center; padding: 0 16px; }
.last-step-label { font-size: 20px; font-weight: 500; color: var(--violet-500); text-align: center; margin-bottom: 10px; }
.phone-input { width: 100%; height: 60px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--grey-100); border-radius: 10px; background-color: var(--grey-50); padding: 0 14px 0 24px; } /* ВЕРТИКАЛЬНЕ ЦЕНТРУВАННЯ: прибрали top/bottom padding */
.country-dropdown { display: flex; align-items: center; gap: 10px; }
.country-text { font-size: 18px; color: var(--grey-950); }
/* приховуємо будь-яку іконку-dropdown, якщо вона з'явиться */
.country-dropdown img { display: none; }
.phone-number-input { flex: 1; height: 100%; display: flex; align-items: center; }
.phone-number-input input { width: 100%; height: 60px; border: none; background: transparent; font-size: 18px; color: var(--grey-950); outline: none; padding: 0; line-height: 60px; } /* ВЕРТИКАЛЬНЕ ЦЕНТРУВАННЯ: line-height 60px */
.phone-number-input input::placeholder { color: var(--grey-500); }
.phone-disclaimer { width: 100%; /* 6. Змінено відступ */ margin-top: 16px; }
.phone-disclaimer p, .phone-disclaimer label { font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 400; color: var(--grey-500); line-height: 1.4; margin: 0; text-align: left; }

/* SSN Step Styles */
.ssn-input { width: 100%; height: 60px; display: flex; align-items: center; border: 1px solid var(--grey-100); border-radius: 10px; background-color: var(--grey-50); padding: 18px 14px 17px 24px; }
.ssn-input input { flex: 1; height: 100%; border: none; background: transparent; font-size: 18px; color: var(--grey-950); outline: none; padding: 0; }
.ssn-input input::placeholder { color: var(--grey-500); }
.ssn-toggle { background: none; border: none; cursor: pointer; padding: 0; }
.ssn-disclaimer { width: 100%; /* 7. Змінено відступ */ margin-top: 16px; }
.ssn-disclaimer p, .ssn-disclaimer label { font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 400; color: var(--grey-500); line-height: 1.4; margin: 0; text-align: left; }
.privacy-notice { width: 100%; display: flex; align-items: flex-start; gap: 14px; margin-top: 24px; }
.privacy-avatar { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.privacy-avatar img { width: 100%; height: 100%; object-fit: cover; }
.privacy-content { flex: 1; background-color: var(--grey-50); border-radius: 8px; padding: 12px 16px; }
.privacy-title { font-size: 14px; font-weight: 600; }
.privacy-text { font-size: 14px; }

/* Final Step Styles */
.final-step-section { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px; min-height: 500px; }
.final-step-container { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.success-message { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.success-title { font-size: 42px; font-weight: 500; text-align: center; line-height: 1; }
.success-subtitle { font-size: 16px; text-align: center; line-height: 1.4; }
.call-notification { width: 100%; max-width: 420px; padding: 12px 20px; display: flex; align-items: center; gap: 10px; border-radius: 8px; background-color: #DCF2EA; }
.notification-icon { width: 32px; height: 32px; }
.notification-text { font-size: 20px; font-weight: 400; color: var(--grey-900); text-align: center; }

/* Responsive Design */
@media (max-width: 768px) {
    .header-content { padding: 20px; justify-content: center; }
    .progress-section { padding: 12px 20px; }
    .progress-content { gap: 20px; }
    /* 1, 9. Скориговано відступ для мобільних */
    .question-section { padding: 48px 20px; }
    /* 6, 7, 9. Скориговано відступи для останніх кроків на мобільних */
    .phone-step-section, .ssn-step-section { padding-top: 24px; padding-bottom: 24px; }
    .question-container { gap: 32px; }
    .question-title h1 { font-size: 28px; line-height: 1.3; }
    .footer-disclaimer { padding: 0 20px 48px 20px; }

    /* Mobile Date Inputs - Responsive Layout */
    .date-inputs { flex-direction: column; gap: 12px; }
    .date-month-row { display: flex; gap: 12px; width: 100%; }
    .date-dropdown:first-child { width: 123px; flex-shrink: 0; }
    .date-dropdown.month-dropdown { flex: 1; }
    .date-dropdown.year-dropdown { width: 100%; }

    /* 6, 7, 9. Зменшено відступи між елементами для мобільних */
    .phone-section .question-container, .ssn-step-section .question-container { gap: 24px; }
    .congratulations-section { margin-bottom: 16px; }
    .phone-disclaimer, .ssn-disclaimer { margin-top: 12px; }
}

@media (max-width: 480px) {
    .question-title h1 { font-size: 26px; }
    .question-subtitle { font-size: 14px; }
    .question-container { gap: 24px; }
    .form-container { gap: 12px; }
}

/* Date Dropdown Styles */
.date-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--grey-100);
    border-radius: 10px;
    box-shadow: 0 4px 32.2px rgba(212, 217, 232, 0.25);
    z-index: 1000;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
}
.date-dropdown-option {
    padding: 16px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: var(--grey-900);
    cursor: pointer;
    border-bottom: 1px solid var(--grey-100);
    transition: background-color 0.2s ease;
}
.date-dropdown-option:last-child { border-bottom: none; }
.date-dropdown-option:hover { background-color: var(--violet-50); }
.date-dropdown-option:first-child { border-radius: 10px 10px 0 0; }
.date-dropdown-option:last-child { border-radius: 0 0 10px 10px; }

.date-dropdown.active {
    border-color: var(--violet-500);
    background-color: white;
    box-shadow: 0 4px 32.2px rgba(59, 56, 235, 0.15);
}
