* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

.language-toggle {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.lang-buttons {
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    font-weight: 600;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.flag-icon {
    width: 16px;
    height: 12px;
    vertical-align: middle;
    margin-right: 2px;
}

.demo-btn {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ff8c00;
    font-weight: 500;
}

.demo-btn:hover {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.5);
    transform: translateY(-1px);
}

.feedback-btn {
    background: rgba(46, 196, 182, 0.1);
    border: 1px solid rgba(46, 196, 182, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2ec4b6;
    font-weight: 500;
}

.feedback-btn:hover {
    background: rgba(46, 196, 182, 0.2);
    border-color: rgba(46, 196, 182, 0.5);
    transform: translateY(-1px);
}

.progress-bar {
    height: 4px;
    background: #f0f0f0;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 9.09%;
    transition: width 0.3s ease;
}

#questionnaire {
    padding: 60px 40px 40px;
    position: relative;
    min-height: 400px;
}

.question-container {
    position: absolute;
    top: 60px;
    left: 40px;
    right: 40px;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s ease;
}

.question-container.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    top: auto;
    left: auto;
    right: auto;
}

.question h2 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.3;
}

.question label {
    color: #4a5568;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}

.question input,
.question textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: #f7fafc;
    transition: all 0.3s ease;
    resize: vertical;
}

.question input:focus,
.question textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.question input::placeholder,
.question textarea::placeholder {
    color: #a0aec0;
}

.question.completed {
    text-align: center;
}

.question.completed h2 {
    color: #38a169;
    margin-bottom: 20px;
}

.question.completed p {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.generate-btn {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.navigation {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 40px;
    background: #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}

.navigation button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#prevBtn {
    background: #e2e8f0;
    color: #4a5568;
}

#prevBtn:hover {
    background: #cbd5e0;
}

#nextBtn {
    background: #667eea;
    color: white;
}

#nextBtn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

#nextBtn:disabled {
    background: #cbd5e0 !important;
    color: #a0aec0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

/* Prevent disabled button from being clickable via CSS */
#nextBtn:disabled {
    pointer-events: none;
}




.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.close:hover {
    color: #333;
}

#cvPreview {
    padding: 50px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #2d3748;
    background: white;
    max-width: 800px;
    margin: 0 auto;
}

.cv-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
}

.cv-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.cv-header > * {
    position: relative;
    z-index: 1;
}

.cv-name {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cv-title {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cv-contact {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cv-contact span {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.cv-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cv-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 18px;
}

.cv-section-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    flex-shrink: 0;
}

.cv-content {
    font-size: 15px;
    white-space: pre-line;
    color: #4a5568;
    line-height: 1.8;
    padding-left: 18px;
}

.download-btn {
    position: sticky;
    bottom: 0;
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #5a67d8;
}

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

    .container {
        margin: 0;
        border-radius: 8px;
        max-width: 100%;
    }

    #questionnaire {
        padding: 60px 25px 20px;
    }

    .question-container {
        left: 25px;
        right: 25px;
        top: 60px;
    }

    .navigation {
        padding: 20px 25px;
    }

    .question h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .question label {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .question input,
    .question textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-width: 1px; /* Thinner border on mobile */
    }

    /* Lighter validation borders on mobile */
    input:invalid:not(:placeholder-shown),
    textarea:invalid:not(:placeholder-shown) {
        border-width: 1px;
        border-color: #fc8181; /* Lighter red */
        box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.08);
    }

    input:invalid[data-has-been-touched="true"],
    textarea:invalid[data-has-been-touched="true"] {
        border-width: 1px;
        border-color: #fc8181;
        box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.08);
    }

    input:valid:not(:placeholder-shown)[data-has-been-touched="true"],
    textarea:valid:not(:placeholder-shown)[data-has-been-touched="true"] {
        border-width: 1px;
        border-color: #68d391; /* Lighter green */
        box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.08);
    }

    input:focus, textarea:focus {
        border-width: 1px;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.08);
    }

    input:not(:placeholder-shown):invalid[data-has-been-touched="true"] {
        border-width: 1px;
        background-color: rgba(229, 62, 62, 0.03);
    }

    input:not(:placeholder-shown):valid[data-has-been-touched="true"] {
        border-width: 1px;
        background-color: rgba(56, 161, 105, 0.03);
    }

    /* Top buttons responsive */
    .language-toggle {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .lang-buttons {
        gap: 2px;
    }

    .lang-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .demo-btn,
    .feedback-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* CV Mobile Styling */
    #cvPreview {
        padding: 30px 20px;
    }

    .cv-header {
        padding: 20px;
        margin-bottom: 30px;
    }

    .cv-name {
        font-size: 28px !important;
    }

    .cv-title {
        font-size: 18px !important;
    }

    .cv-contact {
        flex-direction: column;
        gap: 10px;
    }

    .cv-contact span {
        font-size: 14px;
    }

    .cv-section {
        padding: 20px;
        margin-bottom: 25px;
    }

    .cv-section-title {
        font-size: 16px !important;
    }

    .cv-content {
        font-size: 14px;
        padding-left: 15px;
    }
}

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

.question-container.slide-in {
    animation: slideIn 0.4s ease forwards;
}

/* Validation Styles - Only show invalid state when field has been touched */
input:invalid:not(:placeholder-shown), textarea:invalid:not(:placeholder-shown) {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Show invalid state for touched fields even when empty */
input:invalid[data-has-been-touched="true"], textarea:invalid[data-has-been-touched="true"] {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Only show valid state for touched fields with content */
input:valid:not(:placeholder-shown)[data-has-been-touched="true"],
textarea:valid:not(:placeholder-shown)[data-has-been-touched="true"] {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

/* Default state - neutral styling for untouched fields */
input:not([data-has-been-touched="true"]),
textarea:not([data-has-been-touched="true"]) {
    border-color: #e2e8f0;
    box-shadow: none;
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.success-message {
    color: #38a169;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Enhanced focus states for better accessibility */
input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pattern matching feedback - only for touched fields */
input:not(:placeholder-shown):invalid[data-has-been-touched="true"] {
    border-color: #e53e3e;
    background-color: rgba(229, 62, 62, 0.05);
}

input:not(:placeholder-shown):valid[data-has-been-touched="true"] {
    border-color: #38a169;
    background-color: rgba(56, 161, 105, 0.05);
}

/* Date input template styling */
input[name="birthDate"].template-mode {
    color: #a0aec0; /* Light gray for template text */
}

input[name="birthDate"].typing-mode {
    color: #2d3748; /* Normal dark color when typing */
}

/* Feedback Modal Styles */
.feedback-modal {
    max-width: 500px;
    padding: 30px;
}

.feedback-modal h2 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.feedback-modal p {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.5;
}

.feedback-field {
    margin-bottom: 20px;
}

.feedback-field label {
    display: block;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.feedback-field input,
.feedback-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f7fafc;
    transition: all 0.3s ease;
}

.feedback-field input:focus,
.feedback-field textarea:focus {
    outline: none;
    border-color: #2ec4b6;
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.1);
}

.rating-stars {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star {
    font-size: 24px;
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffd700;
}

.feedback-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.cancel-feedback-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-feedback-btn:hover {
    background: #cbd5e0;
}

.submit-feedback-btn {
    background: #2ec4b6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-feedback-btn:hover {
    background: #26a69a;
    transform: translateY(-1px);
}

.submit-feedback-btn:disabled {
    background: #cbd5e0 !important;
    color: #a0aec0 !important;
    cursor: pointer !important;
    transform: none !important;
    position: relative;
    pointer-events: auto; /* Allow hover for tooltip */
    opacity: 0.6;
}

/* Prevent disabled feedback button from being clickable via CSS */
.submit-feedback-btn:disabled:not(:hover) {
    pointer-events: none;
}

.submit-feedback-btn:disabled:hover {
    pointer-events: auto; /* Allow hover for tooltip */
}

/* Tooltip for disabled feedback submit button */
.submit-feedback-btn:disabled:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    animation: fadeIn 0.3s ease;
}

.submit-feedback-btn:disabled:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #2d3748;
    z-index: 1000;
}

.close-feedback {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.close-feedback:hover {
    color: #333;
}

/* Success buttons container */
.success-buttons,
.final-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.view-cv-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.view-cv-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #e2e8f0;
    color: #4a5568;
    box-shadow: none;
}

.secondary-btn:hover {
    background: #cbd5e0;
    box-shadow: none;
    transform: translateY(-2px);
}

/* CV Edit Mode Styles */
.cv-edit-field {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
}

.cv-edit-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cv-edit-name {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.cv-edit-name::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.cv-edit-name:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.cv-edit-title {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.cv-edit-title::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.cv-edit-title:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.cv-contact-edit {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    text-align: left;
}

.cv-contact-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cv-contact-row label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.cv-contact-row input {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 14px;
}

.cv-contact-row input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.cv-contact-row input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.cv-edit-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

.cv-edit-large {
    min-height: 150px;
}

.cv-edit-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.save-cv-btn {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.save-cv-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.save-cv-btn.saved {
    background: linear-gradient(135deg, #48bb78, #68d391);
}

.resubmit-cv-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.resubmit-cv-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.resubmit-cv-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.resubmit-cv-btn.saved {
    background: linear-gradient(135deg, #48bb78, #68d391);
}

/* Mobile responsive for edit mode */
@media (max-width: 768px) {
    .success-buttons,
    .final-buttons {
        flex-direction: column;
        align-items: center;
    }

    .success-buttons .generate-btn,
    .final-buttons .generate-btn {
        width: 100%;
        max-width: 280px;
    }

    .cv-edit-name {
        font-size: 22px;
    }

    .cv-edit-title {
        font-size: 16px;
    }

    .cv-edit-actions {
        flex-direction: column;
        align-items: center;
    }

    .save-cv-btn,
    .resubmit-cv-btn {
        width: 100%;
        max-width: 280px;
    }
}