/*
 * TenAgile Survey Tool — CSS
 * Design system: teal primary, cream background, white cards
 * Min font-size: 1.3rem
 */

/* ─── Container ─── */
.survey-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: inherit;
    color: #1e293b;
    line-height: 1.6;
}

/* ─── Time Badge Row (below banner) ─── */
.survey-time-badge-row {
    text-align: center;
    padding: 16px 0 24px 0;
}

/* Banner overrides for survey pages */
.survey-container .tek-page-banner .tek-banner-subtitle {
    font-size: 1.6rem !important;
    max-width: 700px;
    margin: 0 auto;
}

.survey-container .tek-page-banner .tek-banner-title {
    font-size: 2.6rem !important;
}

/* ─── Header ─── */
.survey-header {
    text-align: center;
    margin-bottom: 32px;
}

.survey-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.survey-header p {
    font-size: 1.5rem;
    color: #475569;
    margin: 0 0 16px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.survey-time-badge {
    display: inline-block;
    background: rgba(8, 145, 178, 0.1);
    color: #0e7490;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ─── Disclosure ─── */
.survey-disclosure {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 28px;
    font-size: 1.3rem;
    color: #475569;
    line-height: 1.7;
}

.survey-disclosure strong {
    color: #334155;
    display: block;
    margin-bottom: 8px;
    font-size: 1.4rem;
}

/* ─── Email Capture ─── */
.survey-email-capture {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.survey-email-capture h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
}

.survey-form-group {
    margin-bottom: 18px;
}

.survey-form-group label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.survey-form-group input[type="email"],
.survey-form-group input[type="text"],
.survey-form-group textarea,
.survey-form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.survey-form-group input:focus,
.survey-form-group textarea:focus,
.survey-form-group select:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.survey-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ─── Membership Checkbox ─── */
.survey-membership-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 20px 0;
    padding: 16px 20px;
    background: rgba(8, 145, 178, 0.04);
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 8px;
}

.survey-membership-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #0891b2;
    flex-shrink: 0;
    cursor: pointer;
}

.survey-membership-checkbox .checkbox-text {
    font-size: 1.4rem;
    color: #334155;
    line-height: 1.5;
}

.survey-membership-checkbox .checkbox-text strong {
    color: #0e7490;
}

/* Consent checkbox */
.survey-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0 24px 0;
}

.survey-consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #0891b2;
    flex-shrink: 0;
    cursor: pointer;
}

.survey-consent-checkbox label {
    font-size: 1.3rem;
    color: #475569;
    cursor: pointer;
}

/* ─── Start Button ─── */
.survey-start-btn {
    display: block;
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.35);
}

.survey-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Progress Bar ─── */
.survey-progress {
    margin-bottom: 28px;
}

.survey-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.survey-progress-section {
    font-size: 1.4rem;
    font-weight: 600;
    color: #334155;
}

.survey-progress-pct {
    font-size: 1.3rem;
    color: #64748b;
}

.survey-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.survey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ─── Section Card ─── */
.survey-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.3s ease;
}

.survey-section h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

/* ─── Question ─── */
.survey-question {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.survey-question:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.survey-question-text {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 14px;
}

.survey-question-required {
    color: #dc2626;
    margin-left: 4px;
}

/* ─── Options (radio/checkbox cards) ─── */
.survey-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.survey-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
    color: #334155;
}

.survey-option-card:hover {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.02);
}

.survey-option-card.selected {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.06);
    color: #0e7490;
    font-weight: 600;
}

.survey-option-card .option-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.survey-option-card .option-indicator.checkbox-style {
    border-radius: 4px;
}

.survey-option-card.selected .option-indicator {
    border-color: #0891b2;
    background: #0891b2;
}

.survey-option-card.selected .option-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.survey-option-card.selected .option-indicator.checkbox-style::after {
    content: '✓';
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
}

/* ─── Likert Scale ─── */
.survey-likert {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.survey-likert-labels {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 4px;
}

.survey-likert-options {
    display: flex;
    gap: 8px;
}

.survey-likert-btn {
    flex: 1;
    padding: 14px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    transition: all 0.2s;
}

.survey-likert-btn:hover {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.02);
}

.survey-likert-btn.selected {
    border-color: #0891b2;
    background: #0891b2;
    color: #fff;
}

/* ─── Rating (1-10) ─── */
.survey-rating {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.survey-rating-btn {
    width: 44px;
    height: 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.survey-rating-btn:hover {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.04);
}

.survey-rating-btn.selected {
    border-color: #0891b2;
    background: #0891b2;
    color: #fff;
}

/* ─── Yes/No ─── */
.survey-yesno {
    display: flex;
    gap: 12px;
}

.survey-yesno-btn {
    flex: 1;
    padding: 16px 24px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: 700;
    color: #475569;
    text-align: center;
    transition: all 0.2s;
}

.survey-yesno-btn:hover {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.04);
}

.survey-yesno-btn.selected {
    border-color: #0891b2;
    background: #0891b2;
    color: #fff;
}

/* ─── Dropdown ─── */
.survey-dropdown select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* ─── Free Text ─── */
.survey-freetext textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #1e293b;
    resize: vertical;
    font-family: inherit;
}

.survey-freetext textarea:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

/* ─── Navigation ─── */
.survey-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.survey-nav-back {
    padding: 12px 24px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-nav-back:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.survey-nav-next {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-nav-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.survey-nav-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Submit Button ─── */
.survey-submit {
    padding: 14px 36px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35);
}

.survey-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Results — Individual ─── */
.survey-results {
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.survey-results h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
}

/* Score Circle */
.survey-score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 24px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(
        var(--score-color, #0891b2) calc(var(--score-pct, 0) * 3.6deg),
        #e2e8f0 calc(var(--score-pct, 0) * 3.6deg)
    );
}

.survey-score-circle::before {
    content: '';
    position: absolute;
    inset: 12px;
    background: #fff;
    border-radius: 50%;
}

.survey-score-value {
    position: relative;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--score-color, #0891b2);
    z-index: 1;
}

.survey-score-label {
    position: relative;
    font-size: 1.4rem;
    font-weight: 600;
    color: #475569;
    z-index: 1;
}

/* Score animation */
@keyframes countUp {
    from { --score-pct: 0; }
}

.survey-score-circle.animate {
    animation: scoreReveal 1.2s ease-out forwards;
}

@keyframes scoreReveal {
    from {
        background: conic-gradient(var(--score-color, #0891b2) 0deg, #e2e8f0 0deg);
    }
}

/* Category Bars */
.survey-category-bars {
    text-align: left;
    margin: 32px 0;
}

.survey-category-bar {
    margin-bottom: 16px;
}

.survey-category-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #334155;
}

.survey-category-bar-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.survey-category-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
}

.survey-interpretation {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    text-align: left;
}

.survey-interpretation h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.survey-interpretation p {
    font-size: 1.4rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

.survey-recommendation {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0;
    text-align: left;
}

.survey-recommendation h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0e7490;
    margin: 0 0 8px 0;
}

.survey-recommendation p {
    font-size: 1.4rem;
    color: #475569;
    margin: 0;
}

.survey-recommendation a {
    color: #0891b2;
    font-weight: 600;
    text-decoration: none;
}

.survey-recommendation a:hover {
    text-decoration: underline;
}

/* ─── Results — Aggregate ─── */
.survey-aggregate {
    animation: fadeIn 0.4s ease;
}

.survey-aggregate h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.survey-aggregate-count {
    font-size: 1.5rem;
    color: #475569;
    margin-bottom: 32px;
}

.survey-chart-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.survey-chart-container canvas {
    max-height: 400px;
}

.survey-insights {
    margin-top: 32px;
}

.survey-insights h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.survey-insights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.survey-insights li {
    padding: 12px 0 12px 28px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.4rem;
    color: #334155;
    position: relative;
}

.survey-insights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #0891b2;
    font-weight: 700;
}

/* ─── CTA Box ─── */
.survey-cta {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-radius: 12px;
    padding: 32px;
    margin-top: 32px;
    text-align: center;
    color: #fff;
}

.survey-cta h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

.survey-cta p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
}

.survey-cta a {
    display: inline-block;
    padding: 14px 32px;
    background: #fff;
    color: #0891b2;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.survey-cta a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ─── State Messages ─── */
.survey-closed-message,
.survey-already-taken {
    text-align: center;
    padding: 40px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.survey-closed-message h2,
.survey-already-taken h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.survey-closed-message p,
.survey-already-taken p {
    font-size: 1.5rem;
    color: #475569;
    margin: 0 0 20px 0;
}

.survey-closed-message a,
.survey-already-taken a {
    color: #0891b2;
    font-weight: 600;
    text-decoration: none;
}

.survey-closed-message a:hover,
.survey-already-taken a:hover {
    text-decoration: underline;
}

/* ─── Loading ─── */
.survey-loading {
    text-align: center;
    padding: 60px 20px;
}

.survey-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #0891b2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px auto;
}

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

.survey-loading p {
    font-size: 1.4rem;
    color: #64748b;
}

/* ─── Error ─── */
.survey-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 20px 24px;
    text-align: center;
}

.survey-error p {
    font-size: 1.4rem;
    color: #dc2626;
    margin: 0;
}

.survey-error button {
    margin-top: 12px;
    padding: 10px 20px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
}

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

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

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.survey-section.slide-in-left { animation: slideLeft 0.3s ease; }
.survey-section.slide-in-right { animation: slideRight 0.3s ease; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .survey-container {
        padding: 24px 16px;
    }

    .survey-header h1 {
        font-size: 2.2rem;
    }

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

    .survey-email-capture,
    .survey-section {
        padding: 24px 20px;
    }

    .survey-likert-options {
        flex-wrap: wrap;
    }

    .survey-likert-btn {
        flex: 0 0 calc(33.333% - 6px);
    }

    .survey-rating {
        justify-content: center;
    }

    .survey-yesno {
        flex-direction: column;
    }

    .survey-nav {
        flex-direction: column;
        gap: 12px;
    }

    .survey-nav-back,
    .survey-nav-next {
        width: 100%;
        text-align: center;
    }

    .survey-score-circle {
        width: 150px;
        height: 150px;
    }

    .survey-score-value {
        font-size: 2.6rem;
    }
}
