/* ── Risk Profiler — Investor-facing CSS ──────────────────────────────────────
   Covers: language select, questionnaire, result, error pages
   ────────────────────────────────────────────────────────────────────────── */

:root {
    --purple:       #5B2E8C;
    --purple-mid:   #7B4DB8;
    --purple-light: #EDE5F8;
    --purple-xlight:#F5F0FC;
    --text:         #1a1a2e;
    --text-muted:   #6b6b8a;
    --border:       #d8cff0;
    --bg:           #f4f0fb;
    --white:        #ffffff;
    --success:      #27ae60;
    --radius:       14px;
    --shadow:       0 6px 32px rgba(91,46,140,.13);
}

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

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

.investor-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px 40px;
}

/* ── Shell ───────────────────────────────────────────────────────────────── */

.q-shell {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.q-header {
    background: var(--purple);
    padding: 16px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.q-logo {
    max-height: 40px;
    width: auto;
    flex-shrink: 0;
}

.q-firm-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ── Progress ────────────────────────────────────────────────────────────── */

.q-progress-wrap {
    height: 6px;
    background: var(--border);
}

.q-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-mid), var(--purple));
    transition: width .4s ease;
    border-radius: 0 3px 3px 0;
}

.q-progress-label {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 20px 2px;
    background: var(--white);
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.q-card {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 32px 36px 36px;
    position: relative;
    overflow: hidden;
}

.q-card:last-of-type {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.q-footer {
    background: var(--purple-xlight);
    border-radius: 0 0 var(--radius) var(--radius);
    text-align: center;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Language select ─────────────────────────────────────────────────────── */

.lang-card {
    padding: 40px 36px;
}

.lang-title {
    font-size: 22px;
    color: var(--purple);
    margin-bottom: 10px;
    font-weight: 700;
}

.lang-greeting {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 14px;
}

.lang-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.lang-options {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.lang-btn {
    flex: 1;
    min-width: 120px;
    padding: 20px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all .2s;
    font-size: 14px;
    font-weight: 600;
    color: var(--purple);
}

.lang-btn:hover {
    border-color: var(--purple);
    background: var(--purple-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91,46,140,.15);
}

.lang-icon { font-size: 28px; }
.lang-label { font-size: 15px; }

.lang-note {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--purple-xlight);
    border-radius: 8px;
    padding: 10px 14px;
    line-height: 1.5;
}

/* ── Question card ───────────────────────────────────────────────────────── */

.q-inner {
    transition: opacity .2s, transform .2s;
}

.q-inner.slide-out {
    opacity: 0;
    transform: translateX(-20px);
}

.q-inner.slide-in {
    animation: slideIn .3s ease forwards;
}

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

.q-number {
    display: inline-block;
    background: var(--purple-light);
    color: var(--purple);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.q-text {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 10px;
}

.q-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
    font-style: italic;
}

/* ── Option buttons ──────────────────────────────────────────────────────── */

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-option {
    width: 100%;
    padding: 14px 18px;
    text-align: left;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all .15s;
    line-height: 1.4;
}

.q-option:hover {
    border-color: var(--purple-mid);
    background: var(--purple-xlight);
    color: var(--purple);
}

.q-option.selected {
    border-color: var(--purple);
    background: var(--purple-light);
    color: var(--purple);
    font-weight: 600;
}

/* ── Text input ──────────────────────────────────────────────────────────── */

.q-text-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.q-textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    transition: border-color .15s;
}

.q-textarea:focus {
    outline: none;
    border-color: var(--purple);
}

.btn-next {
    align-self: flex-end;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

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

/* ── Loading overlay ─────────────────────────────────────────────────────── */

.q-loading {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.q-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

/* ── Result page ─────────────────────────────────────────────────────────── */

.result-shell .q-card { padding: 40px 36px; }

.result-tick-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.result-tick {
    width: 64px;
    height: 64px;
}

.tick-circle {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke .5s ease forwards;
}

.tick-check {
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke .3s .5s ease forwards;
}

@keyframes stroke { to { stroke-dashoffset: 0; } }

.result-heading {
    text-align: center;
    font-size: 22px;
    color: var(--purple);
    margin-bottom: 6px;
}

.result-sub {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.result-risk-wrap {
    text-align: center;
    background: var(--purple-xlight);
    border: 2px solid var(--purple-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.result-risk-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.result-risk-badge {
    display: inline-block;
    font-size: 20px;
    font-weight: 800;
    padding: 10px 28px;
    border-radius: 30px;
    letter-spacing: .3px;
    margin-bottom: 10px;
    color: #fff;
    background: var(--purple);
}

/* Risk badge colours (match admin palette) */
.result-risk-badge.badge-low              { background: #27ae60; }
.result-risk-badge.badge-low-to-moderate  { background: #2980b9; }
.result-risk-badge.badge-moderate         { background: #8e44ad; }
.result-risk-badge.badge-moderate-high    { background: #e67e22; }
.result-risk-badge.badge-high             { background: #e74c3c; }
.result-risk-badge.badge-very-high        { background: #922b21; }

.result-score {
    font-size: 14px;
    color: var(--text-muted);
}

.result-description {
    background: #f9f7fd;
    border-left: 4px solid var(--purple);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 24px;
}

.result-next-steps {
    margin-bottom: 24px;
}

.result-next-steps h3 {
    font-size: 15px;
    color: var(--purple);
    margin-bottom: 10px;
}

.result-next-steps ul {
    padding-left: 18px;
}

.result-next-steps li {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.btn-result {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
}

.btn-result-outline {
    border: 2px solid var(--purple);
    color: var(--purple);
    background: transparent;
}

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

.result-contact {
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.result-contact p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.result-contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.result-contact-link {
    font-size: 13px;
    color: var(--purple);
    text-decoration: none;
}

.result-contact-link:hover { text-decoration: underline; }

/* ── Error page ──────────────────────────────────────────────────────────── */

.error-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.error-logo {
    max-height: 56px;
    margin-bottom: 20px;
}

.error-card h2 {
    color: var(--purple);
    font-size: 20px;
    margin-bottom: 12px;
}

.error-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* ── Full landing page (SEO/AEO) ─────────────────────────────────────────── */

.landing-body {
    display: block;
    padding: 0;
    background: var(--bg);
}

/* Container */
.lp-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.lp-header {
    background: var(--purple);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(91,46,140,.25);
}
.lp-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lp-brand { display: flex; align-items: center; gap: 12px; }
.lp-logo  { max-height: 36px; width: auto; }
.lp-brand-name { color: #fff; font-size: 17px; font-weight: 700; }
.lp-header-phone {
    color: rgba(255,255,255,.85); font-size: 14px; text-decoration: none;
}
.lp-header-phone:hover { color: #fff; }

/* Hero */
.lp-hero {
    background: linear-gradient(135deg, var(--purple) 0%, #3a1462 100%);
    padding: 64px 0 72px;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}
.lp-hero-content { max-width: 620px; }
.lp-badge {
    display: inline-block;
    background: rgba(255,255,255,.15);
    color: #ede5f8;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.2);
}
.lp-h1 {
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 18px;
}
.lp-h1-accent { color: #ffd666; }
.lp-hero-sub {
    font-size: 16px;
    color: rgba(255,255,255,.85);
    line-height: 1.65;
    margin-bottom: 32px;
    max-width: 540px;
}
.lp-cta-btn {
    display: inline-block;
    background: #fff;
    color: var(--purple);
    font-size: 16px;
    font-weight: 700;
    padding: 15px 36px;
    border-radius: 10px;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 4px 18px rgba(0,0,0,.2);
}
.lp-cta-btn:hover {
    background: var(--purple-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

/* Benefits */
.lp-benefits {
    padding: 64px 0 56px;
    background: var(--white);
}
.lp-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}
.lp-benefit-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 22px;
    transition: box-shadow .2s;
}
.lp-benefit-card:hover {
    box-shadow: 0 4px 18px rgba(91,46,140,.12);
}
.lp-benefit-icon { font-size: 28px; margin-bottom: 12px; }
.lp-benefit-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 8px;
}
.lp-benefit-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* How it works */
.lp-how {
    padding: 56px 0;
    background: var(--bg);
}
.lp-section-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--purple);
    margin-bottom: 36px;
    text-align: center;
}
.lp-steps {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.lp-step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    text-align: center;
}
.lp-step-num {
    width: 48px; height: 48px;
    background: var(--purple);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.lp-step-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.lp-step-body p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
.lp-step-arrow {
    font-size: 28px;
    color: var(--border);
    padding-top: 28px;
    flex-shrink: 0;
}

/* Form section */
.lp-form-section {
    padding: 56px 0 64px;
    background: var(--white);
}
.lp-form-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 6px 32px rgba(91,46,140,.09);
}
.lp-form-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--purple);
    margin-bottom: 4px;
    text-align: center;
}
.lp-form-sub {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 28px;
}

/* FAQ */
.lp-faq {
    padding: 56px 0 64px;
    background: var(--bg);
}
.lp-faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.faq-item[open] {
    border-color: var(--purple);
}
.faq-q {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
    content: '+';
    font-size: 20px;
    color: var(--purple);
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform .2s;
}
.faq-item[open] .faq-q::after {
    content: '−';
}
.faq-a {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    border-top: 1px solid var(--border);
    margin-top: -1px;
}

/* Footer */
.lp-footer {
    background: var(--purple);
    padding: 32px 0 24px;
}
.lp-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.lp-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}
.lp-footer-logo { max-height: 32px; width: auto; }
.lp-footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.lp-footer-links a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: 13px;
}
.lp-footer-links a:hover { color: #fff; }
.lp-footer-copy {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 16px;
}

/* ── Legacy form card (used by walk-in token pages) ──────────────────────── */
.landing-card {
    padding: 40px 36px;
}

.landing-intro {
    margin-bottom: 28px;
}

.landing-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--purple);
    margin-bottom: 10px;
}

.landing-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.landing-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

.landing-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.req  { color: #e74c3c; margin-left: 2px; }
.optional { font-weight: 400; color: var(--text-muted); font-size: 12px; }

.landing-input {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: border-color .15s;
    width: 100%;
}

.landing-input:focus {
    outline: none;
    border-color: var(--purple);
}

.landing-btn {
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    margin-top: 6px;
}

.landing-btn:hover { background: var(--purple-mid); }

.landing-privacy {
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
}
.footer-link:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
    .q-card { padding: 24px 20px 28px; }
    .q-text { font-size: 17px; }
    .lang-options { flex-direction: column; }
    .lang-btn { min-width: unset; flex-direction: row; padding: 14px 18px; }
    .result-shell .q-card { padding: 28px 20px; }
}
