/* ============================================
   QUESTIONNAIRE MÉDICAL - Centre Esthétique & Laser Gramont
   ============================================ */

:root {
    --purple-dark: #5B2D5E;
    --purple-medium: #A782AA;
    --purple-light: #F0EDF1;
    --purple-accent: #7B4B7E;
    --gray-light: #f5f3f6;
    --gray-medium: #ccc;
    --gray-dark: #333;
    --white: #fff;
    --border-radius: 3px;
}

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

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--gray-light);
    color: var(--gray-dark);
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px;
}

/* ---- HEADER ---- */
.form-header {
    background: var(--white);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 0;
    border-bottom: 3px solid var(--purple-dark);
    border-radius: 8px 8px 0 0;
}

.form-header .logo {
    flex-shrink: 0;
}

.form-header .logo img {
    width: 100px;
    height: auto;
}

.form-header .logo-placeholder {
    width: 100px;
    height: 100px;
    background: var(--purple-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-dark);
    font-size: 11px;
    text-align: center;
    padding: 10px;
    font-weight: 600;
}

.form-header h1 {
    font-size: 26px;
    color: var(--purple-dark);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}

.form-header .subtitle {
    color: var(--purple-medium);
    font-size: 13px;
    margin-top: 4px;
}

/* ---- FORM BODY ---- */
.form-body {
    background: var(--white);
    padding: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* ---- IDENTITY BAR ---- */
.identity-bar {
    background: var(--purple-light);
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: center;
}

.identity-bar .field-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.identity-bar label {
    font-weight: 700;
    color: var(--gray-dark);
    white-space: nowrap;
    font-size: 14px;
}

.identity-bar input {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--purple-medium);
    background: transparent;
    padding: 4px 6px;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
    min-width: 80px;
}

.identity-bar input:focus {
    border-bottom-color: var(--purple-dark);
}

/* ---- PERSONAL QUESTIONS ---- */
.personal-section {
    padding: 15px 20px;
}

.personal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 30px;
    margin-bottom: 8px;
}

.personal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.personal-item label {
    white-space: nowrap;
}

.personal-item input[type="text"],
.personal-item input[type="date"],
.personal-item input[type="number"] {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--gray-medium);
    padding: 3px 6px;
    font-size: 13px;
    outline: none;
    min-width: 60px;
}

.personal-item input:focus {
    border-bottom-color: var(--purple-dark);
}

/* ---- RADIO BUTTONS (OUI/NON) ---- */
.radio-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.radio-group label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}

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

.radio-group .radio-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-medium);
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.radio-group input[type="radio"]:checked + .radio-box {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
}

.radio-group input[type="radio"]:checked + .radio-box::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* ---- TEXTAREA ---- */
.textarea-section {
    padding: 0 20px 15px;
}

.textarea-block {
    background: var(--purple-light);
    border-radius: var(--border-radius);
    padding: 12px 15px;
}

.textarea-block label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--gray-dark);
}

.textarea-block textarea {
    width: 100%;
    border: none;
    border-bottom: 1px dashed var(--gray-medium);
    background: transparent;
    resize: vertical;
    font-family: inherit;
    font-size: 13px;
    padding: 4px 0;
    outline: none;
    min-height: 60px;
}

.textarea-block textarea:focus {
    border-bottom-color: var(--purple-dark);
}

/* ---- SECTION TITLES ---- */
.section-title {
    color: var(--purple-dark);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 20px 20px 8px;
    letter-spacing: 0.5px;
}

/* ---- QUESTION ROWS ---- */
.question-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 20px;
    gap: 10px;
    min-height: 36px;
    transition: background 0.15s;
}

.question-row:nth-child(odd) {
    background: var(--purple-light);
}

.question-row:hover {
    background: #e8e2ea;
}

.question-row .question-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    padding-top: 1px;
}

.question-row .question-text small {
    color: #888;
    font-size: 11px;
}

.question-row .radio-group {
    flex-shrink: 0;
}

/* ---- SUB-FIELDS ---- */
.sub-fields {
    padding: 0 20px 8px 30px;
    display: none;
}

.sub-fields.visible {
    display: block;
}

.sub-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.sub-field label {
    white-space: nowrap;
    color: #777;
    min-width: 100px;
}

.sub-field input {
    flex: 1;
    border: none;
    border-bottom: 1px dashed var(--gray-medium);
    padding: 3px 4px;
    font-size: 12px;
    background: transparent;
    outline: none;
}

.sub-field input:focus {
    border-bottom-color: var(--purple-dark);
}

/* ---- SIGNATURE SECTION ---- */
.important-box {
    background: #DCD2E1;
    padding: 15px 20px;
    margin: 20px;
    border-radius: var(--border-radius);
}

.important-box h3 {
    text-decoration: underline;
    margin-bottom: 8px;
    font-size: 14px;
}

.important-box p {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.signature-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background: var(--purple-light);
    padding: 12px 20px;
    margin: 0 20px;
    border-radius: var(--border-radius);
}

.signature-header .sig-block label {
    font-weight: 700;
    font-size: 13px;
    display: block;
}

.signature-header .sig-block small {
    font-size: 10px;
    color: #888;
}

.signature-header .sig-block input {
    border: none;
    border-bottom: 1px solid var(--gray-medium);
    background: transparent;
    padding: 3px 6px;
    width: 100%;
    font-size: 13px;
    outline: none;
    margin-top: 4px;
}

/* ---- SIGNATURE PAD ---- */
.signature-pads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.signature-pad-wrapper {
    text-align: center;
}

.signature-pad-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--purple-dark);
    font-size: 13px;
}

.signature-pad-wrapper canvas {
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    cursor: crosshair;
    width: 100%;
    height: 120px;
    background: #fafafa;
}

.signature-pad-wrapper .clear-sig {
    margin-top: 4px;
    font-size: 11px;
    color: var(--purple-accent);
    cursor: pointer;
    border: none;
    background: none;
    text-decoration: underline;
}

/* ---- LU ET APPROUVÉ ---- */
.lu-approuve-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.lu-approuve-item {
    text-align: center;
}

.lu-approuve-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
    cursor: pointer;
    justify-content: center;
}

.lu-approuve-item input[type="checkbox"] {
    accent-color: var(--purple-dark);
}

.lu-approuve-item .sig-zone {
    width: 100%;
    height: 80px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    background: #fafafa;
    cursor: crosshair;
}

/* ---- SUBMIT ---- */
.submit-section {
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--purple-light);
}

.btn-submit {
    background: var(--purple-dark);
    color: var(--white);
    border: none;
    padding: 12px 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--purple-accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(91, 45, 94, 0.3);
}

.btn-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- STEP NAVIGATION ---- */
.step-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 15px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--purple-light);
}

.step-btn {
    padding: 8px 20px;
    background: var(--purple-light);
    border: 1px solid var(--purple-medium);
    color: var(--purple-dark);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-right: none;
}

.step-btn:first-child {
    border-radius: 5px 0 0 5px;
}

.step-btn:last-child {
    border-radius: 0 5px 5px 0;
    border-right: 1px solid var(--purple-medium);
}

.step-btn.active {
    background: var(--purple-dark);
    color: var(--white);
    border-color: var(--purple-dark);
}

.step-btn:hover:not(.active) {
    background: #e0d4e3;
}

.form-step {
    display: none;
}

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

.step-buttons {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid var(--purple-light);
}

.btn-prev, .btn-next {
    padding: 8px 25px;
    border: 2px solid var(--purple-dark);
    background: var(--white);
    color: var(--purple-dark);
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-next {
    background: var(--purple-dark);
    color: var(--white);
}

.btn-prev:hover {
    background: var(--purple-light);
}

.btn-next:hover {
    background: var(--purple-accent);
}

/* ---- SUCCESS MESSAGE ---- */
.success-message {
    display: none;
    text-align: center;
    padding: 60px 30px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

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

.success-message h2 {
    color: var(--purple-dark);
    margin-bottom: 10px;
}

.success-message p {
    color: #666;
    font-size: 15px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
    .container {
        padding: 10px;
    }

    .form-header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .form-header h1 {
        font-size: 18px;
    }

    .identity-bar {
        grid-template-columns: 1fr;
    }

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

    .signature-header {
        grid-template-columns: 1fr;
    }

    .signature-pads {
        grid-template-columns: 1fr;
    }

    .lu-approuve-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .step-nav {
        flex-wrap: wrap;
        gap: 4px;
    }

    .step-btn {
        border-radius: 4px !important;
        border-right: 1px solid var(--purple-medium) !important;
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* ---- LOADING OVERLAY ---- */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(91, 45, 94, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

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

.loading-spinner {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    color: var(--purple-dark);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--purple-light);
    border-top-color: var(--purple-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

/* ---- PAGE NUMBERS ---- */
.page-indicator {
    text-align: center;
    padding: 5px;
    color: #999;
    font-size: 11px;
}
