/* ================================================
   Global Styles & Reset
   ================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ================================================
   Container & Layout
   ================================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ================================================
   Header
   ================================================ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.instruction {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    text-align: left;
}

.instruction p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ================================================
   Form Sections
   ================================================ */
.form-section {
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: #667eea;
    font-size: 20px;
    font-weight: 600;
    background-color: #f8fafc;
    padding: 12px 16px;
    border-left: 4px solid #667eea;
    margin: 0 0 25px 0;
    border-radius: 4px;
}

/* ================================================
   Question Groups
   ================================================ */
.question-group {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fafafa;
}

.question-group:last-child {
    margin-bottom: 0;
}

.question {
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.5;
}

/* ================================================
   Options & Inputs
   ================================================ */
.options {
    margin: 10px 0;
}

.checkbox-group {
    margin: 8px 0;
    padding: 8px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
    transition: color 0.2s ease;
}

.checkbox-group label:hover {
    color: #667eea;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
    accent-color: #667eea;
}

.text-input {
    margin: 10px 0;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.inline-input {
    margin-top: 8px;
    margin-left: 30px;
    width: calc(100% - 30px);
}

/* ================================================
   Submit Section & Buttons
   ================================================ */
.submit-section {
    text-align: center;
    padding: 30px;
    background-color: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-submit {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.btn-pdf {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-reset {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

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

/* ================================================
   Info Note
   ================================================ */
.info-note {
    margin: 0 30px 30px 30px;
    padding: 16px 20px;
    background-color: #eff6ff;
    border-left: 4px solid #667eea;
    border-radius: 6px;
}

.info-note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.info-note strong {
    color: #667eea;
}

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

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 20px;
    }

    .form-section {
        padding: 20px;
    }

    .form-section h2 {
        font-size: 18px;
    }

    .question-group {
        padding: 15px;
    }

    .submit-section {
        flex-direction: column;
        padding: 20px;
    }

    .btn-submit {
        width: 100%;
    }

    .inline-input {
        margin-left: 0;
        width: 100%;
    }

    .info-note {
        margin: 0 20px 20px 20px;
    }
}

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

    .form-section {
        padding: 15px;
    }

    .form-section h2 {
        font-size: 16px;
        padding: 10px 12px;
    }

    .question {
        font-size: 14px;
    }

    .btn-submit {
        padding: 12px 20px;
        font-size: 15px;
    }

    input[type="text"],
    input[type="number"],
    textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
}

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

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .submit-section,
    .btn-submit {
        display: none;
    }

    .header {
        background: none;
        color: black;
        border-bottom: 2px solid #000;
    }

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

    .question-group {
        page-break-inside: avoid;
    }
}

/* ================================================
   Validation Styles
   ================================================ */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

input:valid:not(:placeholder-shown):not([type="radio"]):not([type="checkbox"]),
textarea:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

/* ================================================
   Accessibility
   ================================================ */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* ================================================
   Animations
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.3s ease;
}

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

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.8s linear infinite;
}

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