/* Services Page — editorial index (distinct from home card grids) */

/* Practice chat — sharp, flat */
.chat-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9000;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    border-radius: var(--radius-buttons);
    padding: 12px 20px;
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    box-shadow: none;
}

.chat-fab:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
}

.chat-fab i {
    font-size: 1rem;
}

.practice-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.practice-chat-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.chat-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 19, 0.55);
}

.chat-container {
    background: var(--surface);
    border-radius: var(--radius-cards);
    border: 1px solid var(--color-slate-dark);
    width: 95%;
    max-width: 420px;
    height: 80vh;
    max-height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

.chat-header {
    background: var(--surface-secondary);
    padding: var(--spacing-16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-cloud-light);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.close-chat-btn {
    background: transparent;
    border: 1px solid var(--color-slate-dark);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-buttons);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-16);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-12);
    background: var(--surface);
}

.message-bubble {
    max-width: 92%;
    padding: var(--spacing-12) var(--spacing-16);
    border-radius: var(--radius-cards);
    font-size: var(--text-body-sm);
    line-height: var(--leading-body-sm);
}

.message-bubble p {
    margin: 0 0 0.5rem;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0.375rem 0 0.5rem;
    padding-left: 1.125rem;
}

.message-bubble li {
    margin-bottom: 0.25rem;
}

.chat-note {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    margin-top: 0.5rem !important;
}

.chat-link {
    color: var(--blue);
    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-message.user .message-bubble .chat-link {
    color: #fff;
}

.chat-message {
    opacity: 1;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.user .message-bubble {
    background: var(--blue);
    color: #fff;
}

.chat-message.assistant .message-bubble {
    background: var(--surface-secondary);
    color: var(--text);
    border: 1px solid var(--color-cloud-light);
}

.quick-suggestions {
    padding: var(--spacing-12) var(--spacing-16);
    border-top: 1px solid var(--color-cloud-light);
}

.suggestions-scroll {
    display: flex;
    gap: var(--spacing-8);
    overflow-x: auto;
}

.suggestion-pill {
    background: transparent;
    border: 1px solid var(--text);
    color: var(--text);
    border-radius: var(--radius-buttons);
    padding: 6px 12px;
    font-size: var(--text-caption);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: inherit;
}

.suggestion-pill:hover {
    background: var(--surface-secondary);
}

.chat-follow-ups {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-8);
    margin-top: 0.375rem;
    max-width: 92%;
}

.follow-up-pill {
    background: transparent;
    border: 1px solid var(--color-cloud-light);
    color: var(--text);
    border-radius: var(--radius-buttons);
    padding: 5px 10px;
    font-size: var(--text-caption);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.follow-up-pill:hover {
    border-color: var(--text);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-12) var(--spacing-16);
    background: var(--surface-secondary);
    border: 1px solid var(--color-cloud-light);
    font-size: var(--text-caption);
    color: var(--text-secondary);
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: chatTyping 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatTyping {
    0%, 80%, 100% { opacity: 0.35; }
    40% { opacity: 1; }
}

.chat-input-area {
    padding: var(--spacing-16);
    border-top: 1px solid var(--color-cloud-light);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-8);
    background: var(--surface-secondary);
    border: 1px solid var(--color-slate-dark);
    border-radius: var(--radius-cards);
    padding: var(--spacing-8) var(--spacing-12);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: var(--text-body-sm);
    font-family: inherit;
    padding: 0.375rem 0;
}

.chat-input:focus {
    outline: none;
}

.send-btn {
    background: var(--blue);
    border: 1px solid var(--blue);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-buttons);
    cursor: pointer;
    flex-shrink: 0;
}

.send-btn:disabled {
    opacity: 0.4;
}

/* Page layout — match insurance.html */
.page-header {
    padding-bottom: var(--spacing-32);
    border-bottom: none;
}

.page-header p {
    max-width: 40rem;
    line-height: var(--leading-subheading);
}

.services-content {
    padding-top: 0;
    padding-bottom: var(--section-gap);
}

.services-catalog {
    margin-bottom: 0;
}

.services-catalog > p {
    text-align: left;
    max-width: 40rem;
    margin: 0 0 var(--spacing-24);
    font-size: var(--text-subheading);
}

.services-catalog .tab-controls {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-8);
    margin-top: var(--spacing-32);
    margin-bottom: var(--spacing-32);
}

.services-catalog .filter-btn {
    background: transparent;
    border: 1px solid var(--text);
    padding: 10px 16px;
    border-radius: var(--radius-buttons);
    color: var(--text);
    font-size: var(--text-body-sm);
    font-family: inherit;
    cursor: pointer;
}

.services-catalog .filter-btn:hover {
    background: var(--surface-secondary);
}

.services-catalog .filter-btn.active {
    background: var(--text);
    color: var(--color-ivory-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-16);
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: var(--card-padding);
    background: var(--surface-secondary);
    border-radius: var(--radius-cards);
    min-height: 120px;
    text-align: left;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.service-card:nth-child(even) {
    background: var(--surface-muted);
}

.service-card:hover {
    border-color: var(--color-slate-dark);
}

.service-card:focus-within {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.service-card .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: var(--spacing-12);
    color: var(--blue);
    font-size: 1.25rem;
}

.service-card h3 {
    font-size: var(--text-heading-sm);
    font-weight: var(--font-weight-medium);
    margin: 0 0 var(--spacing-8);
    color: var(--text);
    line-height: var(--leading-body-sm);
}

.service-category {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-12);
}

.service-card p {
    font-size: var(--text-body-sm);
    color: var(--text-secondary);
    line-height: var(--leading-body-sm);
    margin: 0 0 var(--spacing-12);
    flex: 1;
}

.service-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-12);
    width: 100%;
    margin-top: auto;
}

.service-tag {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.service-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--color-slate-dark);
    border-radius: var(--radius-buttons);
    color: var(--text);
    font-size: var(--text-body-sm);
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.service-card:hover .service-expand {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.services-note {
    text-align: left;
    font-size: var(--text-body-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-32);
    max-width: 40rem;
}

.services-questions {
    background: var(--surface-dark);
    padding: var(--section-gap) 0;
    text-align: left;
}

.services-questions h3 {
    font-family: var(--font-serif);
    font-size: var(--text-heading-lg);
    font-weight: var(--font-weight-regular);
    line-height: var(--leading-heading-lg);
    color: var(--color-ivory-light);
    margin-bottom: var(--spacing-12);
}

.services-questions > .container > p {
    max-width: 40rem;
    margin: 0 0 var(--spacing-32);
    font-size: var(--text-subheading);
    color: var(--color-ivory-dark);
}

.services-questions .office-contacts {
    display: flex;
    justify-content: flex-start;
    gap: var(--spacing-16);
    flex-wrap: wrap;
}

.services-questions .office {
    min-width: 0;
}

.services-questions .office h4 {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-8);
}

.services-questions .office p {
    margin: 0;
    font-size: var(--text-heading-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--blue);
}

/* Service modal — editorial panel */
.service-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 19, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    padding: var(--spacing-32) var(--spacing-16);
    overflow-y: auto;
}

.service-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 720px;
    max-height: none;
    margin: auto 0;
    overflow: hidden;
    border-radius: var(--radius-featuredcards);
    border: 1px solid var(--color-slate-dark);
    box-shadow: none;
}

.modal-header {
    position: static;
    width: auto;
    height: auto;
    padding: var(--card-padding);
    background: var(--surface);
    border-bottom: 1px solid var(--color-cloud-light);
}

.modal-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-16);
}

.modal-header-text {
    flex: 1;
    min-width: 0;
}

.modal-eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin: 0 0 var(--spacing-8);
}

.modal-header .modal-icon {
    display: block;
}

.modal-header .modal-icon .card-icon {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    display: none;
}

.modal-header h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--tracking-heading-lg);
    line-height: var(--leading-heading-lg);
    max-width: none;
    margin: 0;
}

.close-modal {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-buttons);
    background: transparent;
    border: 1px solid var(--color-slate-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
}

.close-modal:hover {
    background: var(--surface-secondary);
}

.modal-body {
    padding: var(--card-padding);
}

.modal-body p {
    font-size: var(--text-body-sm);
    color: var(--text);
    line-height: var(--leading-body-sm);
}

.modal-body h4 {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: var(--font-weight-regular);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: var(--spacing-32) 0 var(--spacing-12);
    color: var(--text-tertiary);
}

.modal-body h4:first-child {
    margin-top: var(--spacing-16);
}

.modal-body ul {
    padding-left: 1.25rem;
    margin: 0 0 var(--spacing-16);
}

.modal-body li {
    font-size: var(--text-body-sm);
    margin-bottom: var(--spacing-8);
    line-height: var(--leading-body-sm);
}

.modal-footer {
    padding: var(--spacing-16) var(--card-padding) var(--card-padding);
    text-align: left;
    border-top: 1px solid var(--color-cloud-light);
    background: var(--surface-secondary);
}

.modal-footer .btn {
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    border-radius: var(--radius-buttons);
    padding: 14px 24px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body-sm);
    font-weight: var(--font-weight-medium);
}

.modal-footer .btn:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
}

.modal-footer .btn i {
    font-size: 0.875rem;
}

@media (min-width: 576px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .service-modal {
        align-items: center;
        padding: var(--spacing-76) var(--spacing-32);
    }

    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: var(--spacing-32) 0 var(--spacing-24);
    }

    .chat-fab .chat-fab-label {
        display: none;
    }

    .chat-fab {
        bottom: 1rem;
        right: 1rem;
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
    }

    .chat-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: none;
        border: none;
    }
}

@media (max-width: 576px) {
    .services-questions .office {
        flex: 1 1 100%;
    }
}
