/* REQUITY Client Assessment Styles */

:root {
    /* Brand Colors */
    --primary-blue: #1E3F7A;
    --deep-text: #102033;
    --secondary-text: #4A607C;
    --white: #FFFFFF;
    --soft-blue: #F3F7FC;
    --blue-border: #D8E5F5;
    
    /* Accents (Warm tones from screenshot) */
    --orange-accent: #F05A28;
    --soft-orange: #FFB089;
    --soft-pink: #F58D92;
    --warm-bg-glow: #FFF4EF;
    
    /* Layout & System */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-premium: 0 16px 40px rgba(30, 63, 122, 0.08), 0 4px 12px rgba(30, 63, 122, 0.03);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--deep-text);
    line-height: 1.5;
    background: radial-gradient(circle at 50% 0%, var(--warm-bg-glow) 0%, var(--soft-blue) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.full-width { width: 100%; }
.hidden { display: none !important; }

.mt-s { margin-top: 0.5rem; }
.mt-m { margin-top: 1.5rem; }
.mt-l { margin-top: 2.5rem; }
.mt-xl { margin-top: 4rem; }
.mb-s { margin-bottom: 0.5rem; }
.mb-m { margin-bottom: 1.5rem; }
.mb-l { margin-bottom: 2.5rem; }

/* Typography */
h1 { font-size: 1.75rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--deep-text); letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--deep-text); }
h3 { font-size: 1.125rem; font-weight: 600; color: var(--deep-text); }
.subtitle { font-size: 1rem; color: var(--secondary-text); }
.question-title { font-size: 1.5rem; font-weight: 500; line-height: 1.3; color: var(--deep-text); }

/* Navigation (Demo Only) */
.demo-nav {
    padding: 1rem 2rem;
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
}
.nav-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.logo { font-weight: 700; font-size: 1.25rem; color: var(--primary-blue); letter-spacing: 0.5px; }

/* Main App Container */
.app-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 4rem 1.5rem;
}

/* White Center Card */
.card {
    background: var(--white);
    width: 100%;
    max-width: 680px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    padding: 3rem 3.5rem;
}

@media (max-width: 600px) {
    .card { padding: 2rem 1.5rem; }
}

/* Thin Orange Top Accent */
.card-top-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--orange-accent), var(--soft-pink));
}

/* Section Icons */
.section-header { text-align: center; margin-bottom: 2rem; }
.icon-circle {
    width: 56px; height: 56px;
    background: var(--warm-bg-glow);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem auto;
}
.icon-circle svg { width: 24px; height: 24px; color: var(--orange-accent); }
.icon-circle.large-icon { width: 72px; height: 72px; }
.icon-circle.large-icon svg { width: 32px; height: 32px; }

/* Progress Bar */
.progress-container { margin-bottom: 2rem; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.5rem; font-weight: 500; }
.p-label { color: var(--secondary-text); text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem;}
.p-status { color: var(--primary-blue); }
.progress-track { width: 100%; height: 6px; background: var(--soft-blue); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--orange-accent), var(--soft-pink)); border-radius: 3px; transition: width 0.4s ease; }

/* Dividers */
.section-divider {
    height: 1px; background: var(--blue-border);
    margin: 2.5rem 0;
}

/* Forms & Inputs */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label { font-size: 0.85rem; font-weight: 500; color: var(--secondary-text); }
.input-group input {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-sm);
    background: var(--soft-blue);
    color: var(--deep-text);
    transition: var(--transition-smooth);
    outline: none;
}
.input-group input:focus { border-color: var(--primary-blue); background: var(--white); box-shadow: 0 0 0 3px rgba(30, 63, 122, 0.05); }
.input-group input::placeholder { color: #A0B3C6; }
.input-group.full-width { grid-column: 1 / -1; }

/* Radio Cards (Buy/Sell + Questions) */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.options-grid.one-col { grid-template-columns: 1fr; gap: 0.75rem; }

.option-card {
    border: 2px solid var(--blue-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--white);
    display: flex; flex-direction: column; gap: 0.25rem;
}
.option-card:hover { border-color: var(--primary-blue); }
.option-card.selected {
    border-color: var(--orange-accent);
    background: var(--warm-bg-glow);
}
.opt-title { font-weight: 500; font-size: 1rem; color: var(--deep-text); }
.option-card.selected .opt-title { color: var(--orange-accent); }
.opt-desc { font-size: 0.85rem; color: var(--secondary-text); }

/* Buttons */
.btn {
    font-family: inherit; font-size: 1rem; font-weight: 500;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer; border: none;
    transition: var(--transition-smooth);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-large { padding: 1.125rem 2rem; font-size: 1.125rem; }
.btn-icon { width: 18px; height: 18px; }

.btn-gradient {
    background: linear-gradient(90deg, var(--orange-accent), var(--soft-pink));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(240, 90, 40, 0.2);
}
.btn-gradient:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(240, 90, 40, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--blue-border);
    color: var(--primary-blue);
}
.btn-outline:hover { background: var(--soft-blue); }

.btn-text {
    background: transparent; color: var(--secondary-text); padding: 0.875rem 1rem;
}
.btn-text:hover { color: var(--deep-text); }

.actions-row { display: flex; justify-content: space-between; align-items: center; }

/* Waiting Page Specifics */
.time-estimate {
    display: inline-block;
    background: var(--soft-blue);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-blue);
}
.timeline-container {
    max-width: 300px;
    text-align: left;
    position: relative;
}
.timeline-container::before {
    content: ''; position: absolute;
    top: 20px; left: 14px; bottom: 20px;
    width: 2px; background: var(--blue-border);
    z-index: 1;
}
.timeline-step {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 2rem; position: relative; z-index: 2;
    opacity: 0.3; transition: opacity 0.4s ease;
}
.timeline-step:last-child { margin-bottom: 0; }
.timeline-step.active { opacity: 1; }
.tl-icon {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--blue-border);
    display: flex; align-items: center; justify-content: center;
    color: transparent; transition: all 0.4s ease;
}
.tl-icon svg { width: 14px; height: 14px; }
.timeline-step.active .tl-icon {
    background: var(--primary-blue); border-color: var(--primary-blue); color: var(--white);
}
.timeline-step.active .tl-text { font-weight: 500; color: var(--deep-text); }
.tl-text { font-size: 0.95rem; color: var(--secondary-text); }

/* Animations */
.fade-in { animation: fadeIn 0.5s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse-anim { animation: pulse 3s infinite ease-in-out; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(240, 90, 40, 0.2); }
    50% { box-shadow: 0 0 0 15px rgba(240, 90, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(240, 90, 40, 0); }
}

.slide-enter { animation: slideEnter 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
@keyframes slideEnter {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}


/* Shared Footer */
.site-footer {
    background: var(--primary-blue);
    color: #ffffff;
    padding: 64px 24px 28px;
    margin-top: 72px;
}
.footer-container {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 56px;
    padding-bottom: 42px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 26px;
}
.footer-brand p {
    color: rgba(255,255,255,0.64);
    font-size: 18px;
    line-height: 1.5;
    max-width: 520px;
}
.footer-column h4 {
    font-size: 20px;
    margin: 0 0 24px;
    color: #ffffff;
}
.footer-column a {
    display: block;
    color: rgba(255,255,255,0.62);
    text-decoration: none;
    font-size: 18px;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}
.footer-column a:hover { color: #ffffff; }
.footer-bottom {
    max-width: 1180px;
    margin: 28px auto 0;
    text-align: center;
    color: rgba(255,255,255,0.42);
    font-size: 17px;
}
@media (max-width: 800px) {
    .footer-container { grid-template-columns: 1fr; gap: 32px; }
    .site-footer { padding: 48px 20px 24px; }
}

/* Hardcoded Animated REQUITY Logo */
.logo,
.footer-logo,
.logo-with-animation {
    line-height: 1;
    overflow: visible;
}

.logo-with-animation {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.logo .requity-animated-logo,
.requity-animated-logo {
    --requity-blue: #003366;
    --requity-orange: #FF6A00;
    display: inline-flex;
    align-items: baseline;
    font-family: 'Nunito', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--requity-blue);
    line-height: 1;
    overflow: visible;
}

.footer-logo .requity-animated-logo {
    --requity-blue: #003366;
    --requity-orange: #FF6A00;
    display: inline-flex;
    align-items: baseline;
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--requity-blue);
    line-height: 1;
    background: #FFFFFF;
    border-radius: 10px;
    padding: 0.42rem 0.75rem 0.62rem;
    overflow: visible;
}

.rq-re,
.rq-uity {
    font-family: 'Nunito', sans-serif;
    color: var(--requity-blue);
}

.rq-q-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9em;
    height: 0.9em;
    margin: 0 0.05em;
    transform: translateY(0.05em);
    /* The REQUITY Q animation intentionally plays once per page reload and
       remains orange after completion. Single iteration + animation-fill-mode:
       forwards holds the final orange state until the next full page reload. */
    animation: rqColorShift 5s 1 cubic-bezier(0.25, 1, 0.5, 1) forwards;
    color: var(--requity-blue);
}

.rq-q-ring {
    position: absolute;
    width: 0.85em;
    height: 0.85em;
    border: 0.15em solid currentColor;
    border-radius: 50%;
}

.rq-q-tail {
    position: absolute;
    bottom: 0.13em;
    right: -0.08em;
    width: 0.5em;
    height: 0.16em;
    background-color: currentColor;
    transform: rotate(42deg);
    transform-origin: center;
    border-radius: 1em;
}

.rq-splash-wrap {
    position: absolute;
    bottom: -0.75em;
    left: 50%;
    width: 1.4em;
    height: 0.8em;
    transform: translateX(-50%);
    pointer-events: none;
    color: var(--requity-orange);
    z-index: 1;
    overflow: visible;
}

.rq-ripple {
    transform-origin: 50% 25px;
    opacity: 0;
}

.rq-ripple-inner { animation: rqSplashInner 5s 1 ease-out forwards; }
.rq-ripple-outer { animation: rqSplashOuter 5s 1 ease-out forwards; }
.rq-ripple-furthest { animation: rqSplashFurthest 5s 1 ease-out forwards; }

.logo-light.review-label {
    margin-left: 0.2rem;
    transform: translateY(0.01em);
}

@keyframes rqColorShift {
    0%, 15% { color: var(--requity-blue); transform: translateY(0.05em) scale(1); }
    22% { color: var(--requity-blue); transform: translateY(-0.1em) scale(1.05); }
    26% { color: var(--requity-orange); transform: translateY(0.1em) scale(0.95, 1.05); }
    32% { color: var(--requity-orange); transform: translateY(-0.02em) scale(1.02); }
    38%, 75% { color: var(--requity-orange); transform: translateY(0.05em) scale(1); }
    /* Final keyframe holds the Q orange (forwards) after the single play. */
    85%, 100% { color: var(--requity-orange); transform: translateY(0.05em) scale(1); }
}

@keyframes rqSplashInner {
    0%, 25% { opacity: 0; transform: scale(0.4) translateY(-10px); }
    28% { opacity: 1; transform: scale(1) translateY(0); }
    45% { opacity: 0; transform: scale(1.2) translateY(5px); }
    100% { opacity: 0; }
}

@keyframes rqSplashOuter {
    0%, 26% { opacity: 0; transform: scale(0.5) translateY(-10px); }
    30% { opacity: 0.8; transform: scale(1) translateY(0); }
    50% { opacity: 0; transform: scale(1.3) translateY(5px); }
    100% { opacity: 0; }
}

@keyframes rqSplashFurthest {
    0%, 27% { opacity: 0; transform: scale(0.6) translateY(-10px); }
    32% { opacity: 0.5; transform: scale(1) translateY(0); }
    55% { opacity: 0; transform: scale(1.4) translateY(5px); }
    100% { opacity: 0; }
}


/* Animated triangle background pattern for assessment */
body {
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
}

.assessment-pattern-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    perspective: 1200px;
    transform-style: preserve-3d;
    opacity: 0.16;
}

.bg-triangle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    transform-origin: 50% 50%;
    pointer-events: none;
    will-change: transform;
    transform-style: preserve-3d;
}

.bg-triangle svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bg-triangle path {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--primary-blue);
    animation: assessmentStrokeShift 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: var(--color-delay);
}

.demo-nav,
.app-container {
    position: relative;
    z-index: 2;
}

@keyframes assessmentStrokeShift {
    0%, 100% { stroke: var(--primary-blue); }
    45%, 55% { stroke: #ff8200; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-triangle { transform: none !important; }
    .bg-triangle path { animation: none !important; stroke: var(--primary-blue); }
}

/* Mobile fit pass */
* { max-width: 100%; }
html, body { overflow-x: hidden; }
img, svg, canvas, video { max-width: 100%; height: auto; }
@media (max-width: 800px) {
  .container, .assessment-shell, .assessment-container, main { width: 100%; padding-left: 16px !important; padding-right: 16px !important; }
  .assessment-card, .question-card, .contact-card, .review-card, .result-card, .form-card { width: 100% !important; }
  .form-grid, .contact-grid, .review-grid, .option-grid, .options-grid { grid-template-columns: 1fr !important; }
  h1 { font-size: clamp(2rem, 9vw, 2.7rem) !important; }
  h2 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; }
  .option, .answer-option, .choice-card { min-height: 48px; }
  .button-row, .assessment-actions, .form-actions { flex-direction: column; align-items: stretch; }
  button, .btn { width: 100%; min-height: 46px; }
}

/* ============================================================================
   Assessment fit pass: every question + answer fits cleanly on screen.
   - Card never exceeds the viewport (no horizontal scroll on any width).
   - Question + answer text wraps cleanly (long words break, no overflow).
   - Answer choices auto-fit and stack on narrow screens.
   - No fixed heights on question/option cards (they grow with content).
   These rules are additive and do not change which answers map to which score.
   ============================================================================ */
.card {
  /* Keep the card inside the viewport with a comfortable gutter at any width. */
  max-width: min(680px, calc(100vw - 32px));
}
.question-title,
.opt-title,
.opt-desc,
.subtitle,
.section-header h1,
.section-header h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.question-title { line-height: 1.35; }
/* Answer grid auto-fits and never forces content off-screen; single long
   options stay full width via the .one-col modifier already in the markup. */
.options-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.option-card { height: auto; min-width: 0; }
.option-card .opt-title,
.option-card .opt-desc { min-width: 0; }
@media (max-width: 560px) {
  .options-grid { grid-template-columns: 1fr; }
  .question-title { font-size: 1.3rem; }
  .card { padding: 1.75rem 1.25rem; }
}

/* "Buying and selling in the same market" shortcut. */
.checkbox-row { margin-top: 0.5rem; }
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #1E3F7A;
  cursor: pointer;
  line-height: 1.35;
}
.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #FF7500;
  cursor: pointer;
}

/* Final open-ended question (agent_expectations_notes). Matches the existing
   input styling; tall enough for a detailed answer and mobile friendly. */
.open-ended-textarea {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.55;
  width: 100%;
  min-height: 190px;
  padding: 0.875rem 1rem;
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  background: var(--soft-blue);
  color: var(--deep-text);
  transition: var(--transition-smooth);
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  display: block;
}
.open-ended-textarea:focus {
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(30, 63, 122, 0.05);
}
.open-ended-textarea::placeholder { color: #A0B3C6; }
