/**
 * Sherpa Guide - Conversational Mortgage Plan Builder
 *
 * Standalone styles for /guide/ page.
 * Centered conversational layout, NOT a chatbot clone.
 * Brand color: #2d5a7b (slate blue).
 */

/* =========================================================================
   Layout
   ========================================================================= */

.guide-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px 60px;
    min-height: 80vh;
}

/* =========================================================================
   Hero / description
   ========================================================================= */

.guide__hero {
    text-align: center;
    padding: 24px 0 0;
}

.guide__title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.guide__subtitle {
    font-size: 16px;
    color: #555;
    margin: 0 0 16px;
}

.guide__preview {
    list-style: none;
    padding: 0;
    margin: 0 auto 0;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.guide__preview li {
    font-size: 14px;
    color: #333;
    line-height: 1.45;
    padding-left: 24px;
    position: relative;
    font-weight: 500;
}

.guide__preview li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #2d5a7b;
    font-weight: 700;
    font-size: 14px;
}

/* =========================================================================
   Conversation container
   ========================================================================= */

.guide {
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   Messages area
   ========================================================================= */

.guide__messages {
    padding: 8px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Bot message --- */

.guide__msg--bot {
    max-width: 85%;
    align-self: flex-start;
    background: #f5f5f5;
    border-radius: 12px 12px 12px 2px;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #1a1a1a;
}

/* --- User message --- */

.guide__msg--user {
    max-width: 75%;
    align-self: flex-end;
    background: #2d5a7b;
    color: #fff;
    border-radius: 12px 12px 2px 12px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.45;
}

/* --- Typing indicator --- */

.guide__msg--typing {
    max-width: 85%;
    align-self: flex-start;
    background: #f5f5f5;
    border-radius: 12px 12px 12px 2px;
    padding: 14px 18px;
}

.guide__typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.guide__typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: guide-dot 1.2s ease-in-out infinite;
}

.guide__typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.guide__typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes guide-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   Input area
   ========================================================================= */

.guide__input-area {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 0 0;
    border-top: 1px solid #e8e8e8;
}

.guide__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.guide__chips:empty {
    display: none;
    margin-bottom: 0;
}

.guide__chip {
    display: inline-block;
    padding: 9px 18px;
    border: 1.5px solid #b8b8b8;
    border-radius: 20px;
    background: #fafafa;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
    line-height: 1.3;
}

.guide__chip:hover {
    border-color: #2d5a7b;
    color: #2d5a7b;
    background: #f0f6fa;
    box-shadow: 0 1px 3px rgba(45, 90, 123, 0.12);
}

.guide__chip:active {
    background: #2d5a7b;
    border-color: #2d5a7b;
    color: #fff;
}

.guide__compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.guide__compose:focus-within {
    opacity: 1;
}

.guide__textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
    transition: border-color 0.15s;
}

.guide__textarea:focus {
    border-color: #2d5a7b;
}

.guide__send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #2d5a7b;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.guide__send:hover {
    background: #1e3f56;
}

.guide__send:disabled {
    background: #ccc;
    cursor: default;
}

/* Step indicator */

.guide__step-indicator {
    font-size: 11px;
    font-weight: 700;
    color: #2d5a7b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.guide__step-indicator:empty {
    display: none;
}

/* Reassurance line */

.guide__reassurance {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin: 8px 0 0;
}

/* Reset / start over */

.guide__reset {
    display: block;
    margin: 8px auto 0;
    background: none;
    border: none;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.guide__reset:hover {
    color: #888;
    text-decoration: underline;
}

/* Build My Plan button */

.guide__build-plan {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 24px;
    background: #2d5a7b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.guide__build-plan:hover {
    background: #1e3f56;
}

/* =========================================================================
   Plan card (renders inline in conversation)
   ========================================================================= */

.guide__plan {
    max-width: 100%;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.guide__plan-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.guide__plan-section:last-child {
    border-bottom: none;
}

.guide__plan-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2d5a7b;
    margin-bottom: 10px;
}

/* Section A: What matters most */

.guide__plan-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide__plan-bullets li {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    padding-left: 18px;
    position: relative;
}

.guide__plan-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2d5a7b;
}

/* Section B: Start here (page cards) */

.guide__plan-pages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide__plan-page {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.guide__plan-page:hover {
    background: #f0f0f0;
}

.guide__plan-step {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2d5a7b;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__plan-page-info {
    flex: 1;
    min-width: 0;
}

.guide__plan-page-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a7b;
    margin-bottom: 2px;
}

.guide__plan-page-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 4px;
}

.guide__plan-page-reason {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

/* Section C: Calculator CTA */

.guide__plan-calc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f0f6fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.guide__plan-calc:hover {
    background: #dce8f0;
}

.guide__plan-calc-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2d5a7b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__plan-calc-info {
    flex: 1;
}

.guide__plan-calc-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a7b;
}

.guide__plan-calc-reason {
    font-size: 13px;
    color: #555;
    margin-top: 2px;
}

/* Section D: Decision shortcut */

.guide__plan-shortcut {
    font-size: 14px;
    line-height: 1.55;
    color: #333;
    font-style: italic;
}

/* =========================================================================
   Page recommendation (followup mode)
   ========================================================================= */

.guide__page-rec {
    display: block;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.guide__page-rec:hover {
    background: #f0f0f0;
}

.guide__page-rec-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a7b;
}

.guide__page-rec-reason {
    font-size: 13px;
    color: #555;
    margin-top: 3px;
}

/* =========================================================================
   Fallback link
   ========================================================================= */

.guide__fallback {
    text-align: center;
    padding: 16px 0;
}

.guide__topics-link {
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
}

.guide__topics-link:hover {
    color: #888;
    text-decoration: underline;
}

/* =========================================================================
   Mobile
   ========================================================================= */

@media (max-width: 640px) {
    .guide-page {
        padding: 0 12px 80px;
    }

    .guide__input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 12px 14px;
        background: #fff;
        z-index: 100;
        border-top: 1px solid #ddd;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }

    .guide__messages {
        padding-bottom: 140px;
    }

    .guide__msg--bot,
    .guide__msg--user {
        max-width: 90%;
    }

    .guide__plan-section {
        padding: 14px 16px;
    }
}
