/* ============================================================
   VectorHX AI Assessment — Styles
   Aligned with vectorhx.com brand guide
   ============================================================ */

:root {
    --primary-purple: #491998;
    --secondary-gray: #6B7280;
    --accent-teal: #0D9488;
    --bg-gray: #F9FAFB;
    --text-dark: #1C2937;
    --border-gray: #E5E7EB;
    --white: #FFFFFF;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================================
   View Toggling
   ============================================================ */

.view--hidden {
    display: none !important;
}

/* ============================================================
   Branding Header — Matches main site nav
   ============================================================ */

.branding {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px clamp(20px, 4vw, 40px);
    z-index: 1000;
    display: flex;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* ============================================================
   Section Header — Sticky on desktop
   ============================================================ */

.section-header {
    position: sticky;
    top: 60px; /* Below branding header */
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-gray);
    padding: 16px 0 14px;
    z-index: 100;
}

.section-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    box-sizing: border-box;
}

.section-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.section-number {
    color: var(--secondary-gray);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-name {
    color: var(--primary-purple);
    font-size: 22px;
    font-weight: 700;
    margin-left: 0;
}

.section-teaching {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    max-width: 800px;
}

.progress-indicator {
    position: absolute;
    top: 0;
    right: 32px;
    font-size: 13px;
    color: var(--secondary-gray);
    background: #F3F4F6;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 500;
}

/* ============================================================
   Main Container
   ============================================================ */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 32px 80px; /* Added top padding for fixed header */
}

/* ============================================================
   Question Block
   ============================================================ */

.question-block {
    background: var(--white);
    border-radius: 12px;
    padding: 32px 36px;
    border-left: 4px solid var(--primary-purple);
    box-shadow: 0 2px 8px rgba(73, 25, 152, 0.06);
}

.question-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.question-number {
    font-size: 20px;
    font-weight: 600;
    color: #9CA3AF;
    flex-shrink: 0;
    line-height: 1.4;
}

.question-content-wrapper {
    flex: 1;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 8px;
}

.question-example {
    font-size: 15px;
    color: var(--secondary-gray);
    line-height: 1.5;
}

/* ============================================================
   Answer Options
   ============================================================ */

.answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 32px; /* Aligns with question text */
}

.answer-option {
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
}

.answer-option.purple-bg {
    background: #F3EFFE;
}

.answer-option.grey-bg {
    background: #F9FAFB;
    color: var(--secondary-gray);
}

.answer-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.answer-option:hover {
    border-color: var(--primary-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.answer-option:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

.answer-option.selected {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: white;
}

.answer-option.selected.grey-bg {
    color: white;
}

.answer-option.selected .answer-radio {
    border-color: white;
    background: white;
}

.answer-option.selected .answer-radio::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-purple);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes selectionPulse {
    0%   { transform: scale(1.0); }
    50%  { transform: scale(1.02); }
    100% { transform: scale(1.0); }
}

.answer-option.selected.changing {
    animation: selectionPulse 0.3s ease;
}

/* ============================================================
   Navigation Buttons
   ============================================================ */

.navigation {
    margin-top: 32px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

button {
    padding: 12px 24px;
    border-radius: 9999px; /* Pill shape */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
    border: none;
}

.btn-back {
    background: white;
    color: var(--secondary-gray);
    border: 1px solid var(--border-gray);
}

.btn-back:hover:not(:disabled) {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.btn-back:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F3F4F6;
}

.btn-next {
    background: var(--primary-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(73, 25, 152, 0.2);
}

.btn-next:hover:not(:disabled) {
    filter: brightness(0.85);
    transform: translateY(-2px);
}

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

/* ============================================================
   Review Screen — Completion Banner
   ============================================================ */

#reviewView {
    padding-top: 60px; /* below fixed branding */
}

.completion-banner {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    padding: 20px 32px;
    border-bottom: 1px solid #059669;
}

.completion-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.completion-icon {
    font-size: 32px;
    color: white;
    flex-shrink: 0;
    line-height: 1;
}

.completion-text {
    color: white;
}

.completion-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.completion-subtitle {
    font-size: 15px;
    opacity: 0.95;
}

/* ============================================================
   Review Screen — Header & Compact Cards
   ============================================================ */

.review-header-section {
    text-align: center;
    margin-bottom: 28px;
}

.review-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.review-count {
    font-size: 15px;
    color: var(--secondary-gray);
}

.review-item-compact {
    background: var(--white);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary-purple);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.review-question-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.review-q-number {
    font-size: 14px;
    font-weight: 600;
    color: #9CA3AF;
    flex-shrink: 0;
}

.review-q-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

.review-answers-compact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 22px;
    margin-bottom: 8px;
}

.review-answer-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    color: var(--secondary-gray);
}

.review-answer-compact.purple-bg {
    background: #F3EFFE;
    color: var(--text-dark);
}

.review-answer-compact.grey-bg {
    background: var(--bg-gray);
    color: var(--secondary-gray);
}

.review-answer-compact.selected {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: white;
    font-weight: 600;
}

.review-answer-radio {
    width: 14px;
    height: 14px;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.review-answer-compact.selected .review-answer-radio {
    border-color: white;
    background: white;
}

.review-answer-compact.selected .review-answer-radio::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-purple);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.review-edit-btn {
    background: none;
    border: none;
    color: var(--primary-purple);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: 22px;
    font-family: inherit;
    text-decoration: underline;
}

.review-edit-btn:hover {
    color: #3a1480;
}

/* ============================================================
   Contact Form View
   ============================================================ */

.form-view-header {
    margin-bottom: 32px;
}

.form-view-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-view-subtitle {
    font-size: 16px;
    color: var(--secondary-gray);
}

.contact-form {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    border-left: 4px solid var(--primary-purple);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 600px;
}

.form-field {
    margin-bottom: 24px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-dark);
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(73, 25, 152, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.form-field.has-error input,
.form-field.has-error textarea {
    border-color: #DC2626;
}

.form-error {
    color: #DC2626;
    font-size: 13px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

.form-field.has-error .form-error {
    display: block;
}

.form-hint {
    font-size: 13px;
    color: var(--secondary-gray);
    margin-top: 6px;
}

.form-submit-area {
    margin-top: 32px;
}

.btn-submit {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(73, 25, 152, 0.25);
}

.btn-submit:hover:not(:disabled) {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(73, 25, 152, 0.3);
}

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

.form-global-error {
    margin-top: 16px;
    color: #DC2626;
    font-size: 14px;
    display: none;
}

.form-global-error.visible {
    display: block;
}

/* ============================================================
   Confirmation View
   ============================================================ */

/* ============================================================
   Loading View
   ============================================================ */

.loading-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 32px;
}

.loading-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #E9E4F8;
    border-top-color: #6B46C1;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 36px;
    flex-shrink: 0;
}

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

.loading-headline {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    max-width: 480px;
}

.loading-subline {
    font-size: 16px;
    color: var(--secondary-gray);
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

/* ============================================================
   Confirmation View
   ============================================================ */

.confirmation-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 32px;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(73, 25, 152, 0.2);
}

.confirmation-icon::after {
    content: '';
    width: 32px;
    height: 18px;
    border-left: 4px solid white;
    border-bottom: 4px solid white;
    transform: rotate(-45deg) translateY(-4px);
    display: block;
}

.confirmation-headline {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    max-width: 600px;
}

.confirmation-details {
    font-size: 16px;
    color: var(--secondary-gray);
    line-height: 1.7;
    max-width: 480px;
}

.confirmation-details p {
    margin-bottom: 8px;
}

.confirmation-details .email-sent-to {
    font-weight: 700;
    color: var(--text-dark);
}

.confirmation-details a {
    color: var(--primary-purple);
    text-decoration: underline;
    font-weight: 500;
}

/* ============================================================
   Intro View — Brand Aligned
   ============================================================ */

#introView {
    padding-top: 60px;
}

.intro-container {
    max-width: 720px;
    padding-bottom: 80px;
}

.intro-headline {
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 800;
    color: var(--primary-purple);
    margin-top: 32px;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.intro-lead {
    font-size: 20px;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 32px;
    font-weight: 400;
}

.intro-text {
    font-size: 17px;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 24px;
}

.intro-box {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 32px 40px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--accent-teal);
}

.intro-box p {
    margin-bottom: 16px;
    font-size: 17px;
    color: var(--text-dark);
    line-height: 1.7;
}

.intro-list {
    margin: 20px 0 24px 24px;
    color: var(--text-dark);
    font-size: 17px;
    line-height: 1.7;
}

.intro-list li {
    margin-bottom: 10px;
    padding-left: 8px;
}

.intro-note {
    font-size: 17px;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 48px;
}

.intro-cta {
    display: flex;
    justify-content: flex-start;
}

.btn-start {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 18px 48px;
    font-size: 19px;
    font-weight: 700;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(73, 25, 152, 0.25);
}

.btn-start:hover {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(73, 25, 152, 0.3);
}

/* ============================================================
   Responsive — Mobile (≤768px)
   ============================================================ */

@media (max-width: 768px) {
    .branding {
        padding: 12px 20px;
    }

    .logo-image {
        max-width: 100px;
        height: auto;
    }

    /* Push survey content below the fixed branding header */
    #surveyView {
        padding-top: 60px;
    }

    /* Section header is NOT sticky on mobile */
    .section-header {
        position: relative;
        top: auto;
        padding: 12px 0 10px;
    }

    .section-header-inner {
        padding: 0 20px;
    }

    .section-number {
        font-size: 13px;
    }

    .section-name {
        font-size: 18px;
    }

    .section-teaching {
        font-size: 14px;
        margin-top: 6px;
    }

    .progress-indicator {
        position: absolute;
        top: 0;
        right: 20px;
        font-size: 12px;
        padding: 4px 12px;
    }

    .container {
        padding: 20px 20px 100px;
    }

    .question-block {
        padding: 24px 20px;
    }

    .question-number {
        font-size: 18px;
    }

    .question-text {
        font-size: 18px;
    }

    .answers {
        gap: 10px;
        margin-left: 0; /* Remove indent on mobile for better space */
    }

    .answer-option {
        padding: 14px 16px;
        font-size: 15px;
    }

    /* Navigation fixed to bottom on mobile */
    .navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid var(--border-gray);
        padding: 12px 20px;
        margin: 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
        z-index: 900;
        justify-content: space-between;
    }

    button {
        padding: 12px 20px;
        font-size: 15px;
    }

    .contact-form {
        padding: 24px 20px;
    }

    .confirmation-view {
        padding: 40px 20px;
    }

    /* Review screen mobile */
    .completion-banner {
        padding: 14px 20px;
    }

    .completion-icon {
        font-size: 26px;
    }

    .completion-title {
        font-size: 17px;
    }

    .completion-subtitle {
        font-size: 13px;
    }

    .review-header-section {
        margin-bottom: 20px;
    }

    .review-title {
        font-size: 22px;
    }

    .review-item-compact {
        padding: 14px 16px;
        margin-bottom: 10px;
    }

    .review-answers-compact {
        margin-left: 20px;
    }

    .review-edit-btn {
        margin-left: 20px;
    }

    .intro-container {
        padding-bottom: 80px;
    }

    .intro-box {
        padding: 24px 20px;
        margin: 24px 0;
    }

    .intro-cta {
        display: flex;
        justify-content: center;
    }

    .btn-start {
        width: 100%;
        padding: 16px 24px;
        justify-content: center;
    }
}

/* ============================================================
   Responsive — Compact Mobile (≤600px)
   ============================================================ */

@media (max-width: 600px) {
    .section-teaching {
        font-size: 14px;
        line-height: 1.45;
        margin-top: 4px;
    }

    .section-name {
        font-size: 18px;
    }

    .section-number {
        font-size: 13px;
    }

    .progress-indicator {
        right: 16px;
        font-size: 11px;
        padding: 3px 10px;
    }

    .container {
        padding: 12px 16px 90px;
    }

    .question-block {
        padding: 16px 16px;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .question-number {
        font-size: 15px;
    }

    .question-text {
        font-size: 17px;
        line-height: 1.4;
    }

    .question-example {
        font-size: 15px;
    }

    .answers {
        gap: 7px;
        margin-left: 0;
    }

    .answer-option {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 6px;
    }

    button {
        padding: 10px 16px;
        font-size: 14px;
    }

}

/* ============================================================
   Responsive — Small Mobile (≤375px)
   ============================================================ */

@media (max-width: 375px) {
    .branding {
        padding: 10px 16px;
    }

    .logo-image {
        max-width: 100px;
        height: auto;
    }

    .section-header {
        padding: 10px 0 8px;
    }

    .section-header-inner {
        padding: 0 16px;
    }

    .container {
        padding: 16px 16px 90px;
    }

    .question-block {
        padding: 20px 16px;
    }

    button {
        padding: 10px 16px;
        font-size: 14px;
    }

}
