/* ============================================================
   FLATIRON QUIZ — quiz.css
   MeetFlatiron Brand Colors:
   - Midnight Navy #1B2838: structure, headers, primary text
   - Ivory #F9F6F0: page background, warm negative space
   - Coral #FF6F61: actions, selections, CTAs ONLY
   - Slate Gray #5A6A7A: secondary text, borders, inactive
   - Muted Gold #DAA520: rare premium accent only
============================================================ */

/* ── Reset ─────────────────────────────────────────────── */
#flatiron-quiz *,
#flatiron-quiz *::before,
#flatiron-quiz *::after,
#fq-results *,
#fq-results *::before,
#fq-results *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Quiz wrapper ──────────────────────────────────────── */
#flatiron-quiz {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    max-width: 720px;
    width: 100%; /* Fluid width */
    margin: 0 auto 32px !important; /* Force center alignment */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    background: #F9F6F0; /* Ivory - warm background */
    /* Override any theme constraints */
    clear: both !important;
    display: block !important;
    position: relative !important;
}

/* GeneratePress specific overrides */
.entry-content #flatiron-quiz,
.inside-article #flatiron-quiz,
article #flatiron-quiz {
    max-width: 720px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure quiz isn't constrained by GeneratePress content width */
.generate-columns-container #flatiron-quiz,
.content-area #flatiron-quiz {
    width: 100% !important;
    max-width: 720px !important;
}

/* ── Header ────────────────────────────────────────────── */
.fq-header {
    background: #1B2838; /* Midnight Navy - structure */
    color: #fff;
    padding: 16px 28px; /* More horizontal padding for emoji */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px; /* More gap between logo and badge */
}

.fq-logo {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px; /* More letter spacing */
    display: inline-block; /* Changed from flex */
    color: #fff;
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Keep from shrinking */
    line-height: 1.2;
}

.fq-step-badge {
    background: rgba(90, 106, 122, 0.25); /* Slate with transparency */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 6px 14px; /* Slightly more vertical padding */
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #F9F6F0; /* Ivory text */
    white-space: nowrap;
    flex-shrink: 0; /* Prevent badge from shrinking */
}

/* ── Progress bar ──────────────────────────────────────── */
.fq-progress {
    height: 6px; /* Increased from 4px for better visibility */
    background: rgba(90, 106, 122, 0.15); /* Lighter background for contrast */
}

.fq-progress-fill {
    height: 100%;
    background: #FF6F61; /* Coral - active progress only */
    border-radius: 0 3px 3px 0; /* Slightly rounded end */
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Body ──────────────────────────────────────────────── */
.fq-body {
    padding: 36px 32px; /* More generous padding all around */
    min-height: 400px; /* Taller for better proportion */
    background: #F9F6F0; /* Ivory warm background */
}

/* ── Step panels ───────────────────────────────────────── */
.fq-step {
    display: none;
}

.fq-step.active {
    display: block;
    animation: fqFadeUp 0.3s ease both;
}

@keyframes fqFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fq-step h2 {
    font-size: 24px; /* Restored to original size - better hierarchy */
    font-weight: 800;
    color: #1B2838; /* Midnight Navy - primary heading */
    line-height: 1.3; /* Better line height for readability */
    margin-bottom: 12px; /* More space below heading */
}

.fq-step h2 em {
    font-style: normal;
    color: #FF6F61; /* Coral - headline emphasis word ONLY */
}

.fq-sub {
    font-size: 14px; /* Restored to 14px for better readability */
    color: #5A6A7A; /* Slate Gray - secondary text */
    margin-bottom: 32px; /* More space before options - Google recommends 24px+ */
    line-height: 1.6; /* Better readability */
}

/* ── Option grids ──────────────────────────────────────── */
.fq-options {
    display: grid;
    gap: 14px; /* More gap between cards - Google recommends 12px+ */
    margin-bottom: 32px; /* More space before navigation */
}

.fq-cols-1 { grid-template-columns: 1fr; }
.fq-cols-2 { grid-template-columns: 1fr 1fr; }

/* ── Option card ───────────────────────────────────────── */
.fq-option {
    border: 1.5px solid #D4D8DD; /* Soft gray border - default */
    border-radius: 12px;
    padding: 18px 20px; /* More generous padding like TruIC */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px; /* More gap between elements */
    background: #ffffff; /* White card - default state */
    text-align: left;
    width: 100%;
    min-height: 72px; /* Taller minimum height */
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box !important; /* Force proper box sizing */
}

.fq-option:hover {
    border-color: #FF6F61; /* Coral on hover */
    background: #FFF9F8; /* Very light coral tint */
    transform: translateY(-2px); /* Slightly more lift for feedback */
    box-shadow: 0 4px 16px rgba(255, 111, 97, 0.15); /* More visible shadow */
}

.fq-option:focus-visible {
    outline: 3px solid #FF6F61; /* Coral focus */
    outline-offset: 2px;
}

.fq-option.selected {
    border-color: #FF6F61; /* Coral border - selected */
    background: #FFF3F2; /* Pale coral background - selected */
    box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.15);
}

.opt-icon {
    font-size: 26px; /* Slightly larger for better visibility */
    flex-shrink: 0;
    line-height: 1;
    margin-right: 4px; /* Extra space after icon */
}

.opt-text {
    flex: 1;
    min-width: 0; /* Allow text to shrink */
    padding-right: 8px; /* Space before checkbox */
}

.opt-title {
    display: block;
    font-weight: 700;
    font-size: 15px; /* Restored for better readability */
    color: #1B2838; /* Midnight Navy */
    margin-bottom: 4px; /* More space between title and description */
    line-height: 1.3;
}

.opt-desc {
    display: block;
    font-size: 12px; /* Kept at 12px - good for secondary text */
    color: #5A6A7A; /* Slate Gray - secondary */
    line-height: 1.5; /* Better readability */
}

.opt-check {
    width: 22px; /* Restored size */
    height: 22px;
    border-radius: 50%;
    border: 2px solid #D4D8DD; /* Soft gray - inactive */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s;
    font-size: 12px;
    color: transparent;
    font-weight: 700;
    margin-left: 8px; /* Space from text */
}

.fq-option.selected .opt-check {
    background: #FF6F61; /* Coral fill - selected */
    border-color: #FF6F61;
    color: #ffffff;
}

.fq-option.selected .opt-check::after {
    content: '✓';
}

/* ── Email step ────────────────────────────────────────── */
.fq-email-wrap {
    background: #ffffff; /* White card */
    border: 1.5px solid #D4D8DD; /* Soft gray border */
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.fq-email-wrap > p {
    font-size: 14px;
    color: #1B2838; /* Midnight Navy */
    margin-bottom: 18px;
    line-height: 1.5;
}

.fq-input-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fq-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
}

.fq-field-grow {
    flex: 1;
}

.fq-field label {
    font-size: 12px;
    font-weight: 600;
    color: #5A6A7A; /* Slate Gray */
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fq-required {
    color: #FF6F61; /* Coral for required indicator */
}

.fq-field input[type="text"],
.fq-field input[type="email"] {
    border: 1.5px solid #D4D8DD; /* Soft gray */
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
    color: #1B2838; /* Midnight Navy */
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.fq-field input:focus {
    border-color: #FF6F61; /* Coral on focus */
    box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.1);
}

.fq-field input.fq-input-error {
    border-color: #dc2626;
}

.fq-privacy {
    font-size: 11px !important;
    color: #5A6A7A !important; /* Slate Gray */
    margin-top: 10px !important;
    margin-bottom: 0 !important;
}

.fq-error {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
    font-weight: 500;
}

/* ── Navigation ────────────────────────────────────────── */
.fq-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px; /* More space above navigation */
}

.fq-btn-back {
    background: none;
    border: none;
    color: #5A6A7A; /* Slate Gray */
    font-size: 14px;
    cursor: pointer;
    padding: 10px 8px; /* Better touch target */
    font-weight: 500;
    transition: color 0.2s;
    font-family: inherit;
    min-height: 44px; /* Google minimum touch target */
}

.fq-btn-back:hover {
    color: #1B2838; /* Midnight Navy on hover */
}

.fq-btn-next,
.fq-btn-submit {
    background: #FF6F61; /* Coral - primary CTA */
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px 28px; /* Larger padding for better CTA prominence */
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
    box-shadow: 0 4px 16px rgba(255, 111, 97, 0.35); /* More prominent shadow */
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px; /* Google minimum touch target */
    white-space: nowrap;
}

.fq-btn-next:hover:not(:disabled),
.fq-btn-submit:hover:not(:disabled) {
    background: #FF5A4A; /* Slightly darker coral on hover */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 111, 97, 0.4);
}

.fq-btn-next:focus-visible,
.fq-btn-submit:focus-visible {
    outline: 3px solid #FF6F61;
    outline-offset: 3px;
}

.fq-btn-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fq-btn-submit.fq-loading {
    opacity: 0.75;
    cursor: wait;
    pointer-events: none;
}

/* ── Results panel ─────────────────────────────────────── */
#fq-results {
    max-width: 720px;
    width: 100%;
    margin: 0 auto !important; /* Force center alignment */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    animation: fqFadeUp 0.4s ease both;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Override any theme constraints */
    clear: both !important;
    display: block !important;
    position: relative !important;
}

/* GeneratePress specific overrides for results */
.entry-content #fq-results,
.inside-article #fq-results,
article #fq-results {
    max-width: 720px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.generate-columns-container #fq-results,
.content-area #fq-results {
    width: 100% !important;
    max-width: 720px !important;
}

.fq-results-header-bar {
    background: #1B2838; /* Midnight Navy */
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fq-results-badge {
    background: rgba(90, 106, 122, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #F9F6F0; /* Ivory */
}

.fq-results-body {
    background: #F9F6F0; /* Ivory warm background */
    padding: 28px 24px; /* Reduced from 36px */
}

.fq-results-title-block {
    text-align: center;
    margin-bottom: 32px;
}

.fq-results-title-block h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1B2838; /* Midnight Navy */
    margin-bottom: 8px;
}

.fq-results-title-block p {
    font-size: 15px;
    color: #5A6A7A; /* Slate Gray */
    line-height: 1.5;
}

.fq-results-title-block p strong {
    color: #FF6F61; /* Coral emphasis */
}

.fq-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5A6A7A; /* Slate Gray */
    margin: 24px 0 12px;
}

/* ── Result cards ──────────────────────────────────────── */
.fq-result-card {
    border: 1.5px solid #D4D8DD; /* Soft gray border */
    border-radius: 12px;
    padding: 16px; /* Reduced from 20px */
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px; /* Reduced from 16px */
    position: relative;
    transition: box-shadow 0.2s;
    background: #ffffff; /* White card */
}

.fq-result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.fq-result-card.fq-featured {
    border-color: #FF6F61; /* Coral border for featured */
    background: #FFF9F8; /* Very light coral tint */
}

.fq-badge {
    position: absolute;
    top: -10px;
    left: 16px;
    background: #DAA520; /* Muted Gold - premium badge ONLY */
    color: #1B2838; /* Midnight Navy text */
    font-size: 9px; /* Reduced from 10px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px; /* Reduced from 3px 10px */
    border-radius: 20px;
    white-space: nowrap;
}

.fq-result-icon {
    font-size: 28px; /* Reduced from 34px */
    flex-shrink: 0;
    line-height: 1;
}

.fq-result-info {
    flex: 1;
    min-width: 0;
}

.fq-result-info h4 {
    font-size: 15px; /* Reduced from 16px */
    font-weight: 700;
    color: #1B2838; /* Midnight Navy */
    margin-bottom: 4px;
}

.fq-result-info p {
    font-size: 12px; /* Reduced from 13px */
    color: #5A6A7A; /* Slate Gray */
    line-height: 1.45;
    margin-bottom: 6px;
}

.fq-tag {
    display: inline-block;
    background: #E8E8E8; /* Light gray tag */
    color: #5A6A7A; /* Slate Gray */
    font-size: 10px; /* Reduced from 11px */
    font-weight: 600;
    padding: 2px 7px; /* Reduced from 2px 8px */
    border-radius: 4px;
}

.fq-result-cta {
    flex-shrink: 0;
}

.fq-result-cta a {
    display: inline-block;
    background: #1B2838; /* Midnight Navy - secondary button */
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 9px 16px; /* Reduced from 10px 18px */
    border-radius: 8px;
    font-size: 12px; /* Reduced from 13px */
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s;
    font-family: inherit;
}

.fq-result-cta a:hover {
    background: #2a3f52; /* Lighter navy on hover */
}

.fq-result-card.fq-featured .fq-result-cta a {
    background: #FF6F61; /* Coral for featured CTA */
}

.fq-result-card.fq-featured .fq-result-cta a:hover {
    background: #FF5A4A; /* Darker coral on hover */
}

/* ── Restart button ────────────────────────────────────── */
.fq-restart-wrap {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #D4D8DD;
}

#fq-restart-btn {
    background: none;
    border: none;
    color: #5A6A7A; /* Slate Gray */
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
    text-decoration: underline;
}

#fq-restart-btn:hover {
    color: #1B2838; /* Midnight Navy on hover */
}

/* ── Responsive ────────────────────────────────────────── */
/* Sidebar/tablet: Graceful scaling for medium widths */
@media (max-width: 720px) {
    .fq-body { padding: 28px 24px; }
    .fq-header { padding: 14px 20px; }
    .fq-step h2 { font-size: 22px; }
    .opt-icon { font-size: 24px; }
    .opt-title { font-size: 14px; }
}

/* Narrow sidebar: Stack cards vertically */
@media (max-width: 640px) {
    .fq-cols-2 { grid-template-columns: 1fr; }
    .fq-body { padding: 24px 20px; }
}

/* Mobile: Compact but still readable */
@media (max-width: 480px) {
    .fq-body          { padding: 20px 16px; }
    .fq-header        { padding: 12px 16px; }
    .fq-results-body  { padding: 24px 16px; }
    .fq-step h2       { font-size: 20px; }
    .fq-sub           { font-size: 13px; margin-bottom: 24px; }
    .opt-title        { font-size: 14px; }
    .opt-desc         { font-size: 11px; }
    .opt-icon         { font-size: 22px; }
    
    .fq-result-card   { flex-wrap: wrap; padding: 14px; }
    .fq-result-cta    { width: 100%; margin-top: 8px; }
    .fq-result-cta a  { width: 100%; text-align: center; display: block; padding: 12px; }

    .fq-input-row     { flex-direction: column; }
    .fq-field         { min-width: 100%; }
    
    .fq-btn-next,
    .fq-btn-submit    { padding: 12px 20px; font-size: 14px; }
}
