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

:root {
    --primary-color: #5B8FD8;
    --primary-dark: #4A7AC4;
    --secondary-color: #000000;
    --bg-cream: #E8DED3;
    --bg-light: #F5F1ED;
    --white: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-gray: #666666;
    --error-color: #E74C3C;
    --success-color: #27AE60;
    --border-color: #D4C9BD;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #E8DED3 0%, #F5F1ED 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-in-out;
}

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

/* Header */
.form-header {
    text-align: center;
    padding: 40px 20px;
    animation: slideDown 0.8s ease-out;
}

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

.logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.form-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-container {
    background: var(--white);
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 14.28%; /* 1/7 sections */
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

/* Form Sections */
.form-section {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: none;
    animation: slideIn 0.5s ease-out;
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-hover);
}

.form-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--bg-cream);
}

.section-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(91, 143, 216, 0.3);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.section-desc {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 1rem;
}

.required {
    color: var(--error-color);
    font-weight: bold;
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"] {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(91, 143, 216, 0.1);
    transform: translateY(-2px);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="number"]:hover {
    border-color: var(--primary-color);
}

input.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    animation: shake 0.3s ease;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    flex: 1;
    font-weight: 500;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(91, 143, 216, 0.05);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

.radio-label input[type="radio"]:checked ~ * {
    color: var(--primary-color);
}

/* Conditional Fields */
.conditional-field {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.conditional-field.show {
    max-height: 200px;
    opacity: 1;
    margin-top: 10px;
}

/* Document Checklist */
.document-checklist {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.checkbox-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: rgba(91, 143, 216, 0.08);
    transform: translateX(5px);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.75rem;
}

.checkbox-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.checkbox-content i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Buttons */
.section-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.btn-next,
.btn-submit {
    background: var(--secondary-color);
    color: var(--white);
    margin-left: auto;
}

.btn-next:hover,
.btn-submit:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-back {
    background: transparent;
    color: var(--text-gray);
    border: 2px solid var(--border-color);
}

.btn-back:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: bounce 0.6s ease 0.3s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.success-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.modal-content h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.modal-content p {
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
    padding: 14px 40px;
}

.btn-primary:hover {
    background: #333333;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(232, 222, 211, 0.95);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(91, 143, 216, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .form-header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .logo {
        max-width: 220px;
    }

    .form-section {
        padding: 25px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .radio-group {
        flex-direction: column;
    }

    .section-actions {
        flex-direction: column;
    }

    .btn-next,
    .btn-submit {
        margin-left: 0;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .form-header h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .btn,
    .progress-container {
        display: none;
    }

    .form-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
