/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Resume Notification */
.resume-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    font-size: 0.95rem;
}

.resume-notification.success {
    background: #d4edda;
    color: #155724;
    border-bottom: 2px solid #28a745;
}

.resume-notification.error {
    background: #f8d7da;
    color: #721c24;
    border-bottom: 2px solid #dc3545;
}

.resume-notification button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    color: inherit;
}

.resume-notification button:hover {
    opacity: 1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header Styles */
.header {
    width: 100%;
}

.header-top {
    background: #1a365d;
    padding: 0.5rem 0;
}

.logo {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
}

.logo-text {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-main {
    background: transparent;
    padding: 2.5rem 2rem;
    text-align: center;
}

.header-title {
    color: #1e3a5f;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: 1200px;
    margin: 0 auto;
}

/* Disclaimer Banner */
.disclaimer-banner {
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: 0.35rem 1rem;
    width: 100%;
}

.disclaimer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.7rem;
    color: #92400e;
    text-align: left;
    padding-left: 1rem;
    white-space: nowrap;
}

.disclaimer-content strong {
    color: #78350f;
}

/* Progress Steps */
.progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    background: white;
    border-radius: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 0 2rem;
    width: calc(100% - 4rem);
    box-sizing: border-box;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: #2c5282;
    color: white;
}

.progress-step.completed .step-number {
    background: #22c55e;
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    max-width: 150px;
}

.progress-step.active .step-label {
    color: #2c5282;
    font-weight: 500;
}

.progress-line {
    width: 100px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 1rem;
    margin-bottom: 1.5rem;
}

/* Benefits Section */
.benefits-section {
    margin: 0 2rem;
    padding: 1.5rem 2rem;
    width: calc(100% - 4rem);
    background: white;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.benefits-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 4rem;
}

.benefits-column {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.benefit-check {
    color: #22c55e;
    font-size: 1.25rem;
    font-weight: bold;
}

.benefit-text {
    font-size: 0.9rem;
    color: #333;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    margin: 0;
    width: 100%;
}

/* Form Sections */
.form-section {
    display: block;
    background: white;
    border-radius: 0;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

/* Form Steps - Progressive reveal */
.form-step {
    display: none;
}

.form-step.visible {
    display: block;
}

.form-step.visible.just-revealed {
    animation: fadeInStep 0.3s ease;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide Next button when step is completed */
.form-step.completed .btn-next {
    display: none;
}

/* Hide step actions when completed (except for last step) */
.form-step.completed .step-actions {
    display: none;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.step-actions .btn-next {
    margin-left: auto;
}

.step-actions .btn-prev {
    margin-right: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.5rem;
    color: #1e3a5f;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.subsection-title {
    font-size: 1.1rem;
    color: #2c5282;
    margin: 1.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-group.full-width {
    grid-column: span 2;
}

/* Form Elements */
label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.label-with-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.help-icon:hover {
    background: #2c5282;
    color: white;
}

.help-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: #1e293b;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.help-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #1e293b;
    transform: rotate(45deg);
}

.help-container {
    position: relative;
}

.label-with-help.active .help-tooltip {
    display: block;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.required {
    color: #dc2626;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

input.error,
select.error {
    border-color: #dc2626;
}

.field-note {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}

/* Phone Input - Webflow Style */
.phone-input-wrapper {
    display: flex;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.phone-country-selector {
    position: relative;
    flex-shrink: 0;
}

.phone-country-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.75rem;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    height: 100%;
    border-radius: 7px 0 0 7px;
    transition: background-color 0.2s;
}

.phone-country-btn:hover {
    background: #f1f5f9;
}

.selected-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.dropdown-arrow {
    font-size: 0.5rem;
    color: #64748b;
    transition: transform 0.2s;
}

.phone-country-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

.phone-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.phone-country-selector.open .phone-dropdown {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phone-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    outline: none;
}

.phone-search:focus {
    background: #f8fafc;
}

.phone-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
}

.phone-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background-color 0.1s;
}

.phone-dropdown-item:hover {
    background: #f1f5f9;
}

.phone-dropdown-item.selected {
    background: #e0f2fe;
}

.phone-dropdown-item .flag {
    font-size: 1.25rem;
}

.phone-dropdown-item .country-name {
    flex: 1;
    font-size: 0.9rem;
    color: #1e293b;
}

.phone-dropdown-item .country-code {
    font-size: 0.85rem;
    color: #64748b;
}

.phone-number-input {
    display: flex;
    align-items: center;
    flex: 1;
    background: transparent;
    border-radius: 0 7px 7px 0;
}

.phone-code-display {
    padding-left: 0.5rem;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.phone-number-input input {
    flex: 1;
    padding: 0.75rem 0.75rem;
    border: none;
    border-left: none;
    font-size: 1rem;
    outline: none;
    background: transparent;
    border-radius: 0 7px 7px 0;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.phone-number-input input::-webkit-outer-spin-button,
.phone-number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.phone-number-input input::placeholder {
    color: #9ca3af;
}

.phone-number-input input:focus {
    outline: none;
    border: none;
    box-shadow: none;
    -webkit-box-shadow: none;
}

.phone-input-wrapper.error {
    border-color: #dc2626;
}

.phone-input-wrapper.error:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.phone-dropdown-empty {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Radio and Checkbox Groups */
.radio-group {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

/* Error message for radio buttons and checkboxes - always below the group */
.form-group > .radio-group + .error-message,
.form-group > .checkbox-label + .error-message,
.form-group > .error-message:last-child {
    display: block;
    margin-top: 0.5rem;
    clear: both;
}

/* Ensure checkbox form groups display properly */
.declaration-checkboxes .form-group {
    display: flex;
    flex-direction: column;
}

.declaration-checkboxes .form-group .error-message {
    margin-top: 0.35rem;
    margin-left: 0;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input,
.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2c5282;
}

/* Declaration Section */
.declaration-questions {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.declaration-questions .form-group {
    margin-bottom: 1.5rem;
}

.declaration-questions .form-group:last-child {
    margin-bottom: 0;
}

.declaration-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    align-items: flex-start;
}

.checkbox-label input {
    margin-top: 3px;
    flex-shrink: 0;
}

.checkbox-label a {
    color: #2c5282;
    text-decoration: underline;
}

/* Buttons */
.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #047857;
    color: white;
}

.btn-primary:hover {
    background: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-submit {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    justify-content: center;
}

/* Error Messages */
.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Eligibility Warning */
.eligibility-warning,
.passport-mismatch-warning {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
}

.eligibility-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.passport-mismatch-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-content strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.eligibility-warning .warning-content strong {
    color: #991b1b;
}

.passport-mismatch-warning .warning-content strong {
    color: #92400e;
}

.warning-content p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.eligibility-warning .warning-content p {
    color: #b91c1c;
}

.passport-mismatch-warning .warning-content p {
    color: #a16207;
}

/* Declaration Warning (for criminal conviction and war crimes questions) */
.declaration-warning {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    animation: warningFadeIn 0.3s ease-out;
}

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

.declaration-warning .warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.declaration-warning .warning-content {
    flex: 1;
}

.declaration-warning .warning-content strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    color: #991b1b;
}

.declaration-warning .warning-content p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #b91c1c;
}

/* Footer */
.footer {
    background: #1e3a5f;
    color: white;
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        padding: 0.5rem 1rem;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .header-main {
        padding: 1.5rem 1rem;
    }

    .header-title {
        font-size: 1.1rem;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }

    .disclaimer-content {
        white-space: normal;
        text-align: center;
        padding-left: 0;
        font-size: 0.65rem;
        line-height: 1.4;
    }

    .progress-container {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 1rem;
        gap: 0;
        overflow-x: auto;
        margin: 0 1rem;
        width: calc(100% - 2rem);
        max-width: none;
    }

    .progress-step {
        flex-shrink: 0;
        min-width: auto;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.7rem;
        max-width: 80px;
    }

    .benefits-section {
        padding: 1rem;
        margin: 0 1rem;
        width: calc(100% - 2rem);
        max-width: none;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .benefit-text {
        font-size: 0.85rem;
    }

    .progress-line {
        width: 30px;
        height: 2px;
        margin: 0 0.25rem;
        margin-bottom: 1.5rem;
        flex-shrink: 0;
    }

    /* Sticky submit button on mobile */
    .form-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 100;
        margin: 0;
    }

    /* Declaration section submit button should NOT be fixed - flows under checkboxes */
    .form-section[data-step="5"] .form-actions {
        position: static;
        background: transparent;
        padding: 0;
        box-shadow: none;
        margin-top: 1.5rem;
    }

    .main-content {
        padding: 0 1rem;
        padding-top: 1rem;
        padding-bottom: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .form-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .footer {
        padding-bottom: 80px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .phone-dropdown {
        width: 260px;
    }
}

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

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success/Info Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

/* Searchable Select Dropdown */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select .search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    cursor: text;
}

.searchable-select .search-input:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.searchable-select .search-input.error {
    border-color: #dc2626;
}

.searchable-select .search-input.has-value {
    background-color: #f0f9ff;
}

.searchable-select .dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.searchable-select.open .dropdown-list {
    display: block;
}

.searchable-select.open .search-input {
    border-radius: 8px 8px 0 0;
}

.searchable-select .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.95rem;
}

.searchable-select .dropdown-item:hover,
.searchable-select .dropdown-item.highlighted {
    background-color: #e0f2fe;
}

.searchable-select .dropdown-item.selected {
    background-color: #2c5282;
    color: white;
}

.searchable-select .no-results {
    padding: 0.75rem 1rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
}
