/* Red Rock Health Pay — canyon-inspired, clean */

:root {
    --canvas: #faf9f7;
    --ink: #1c1917;
    --mute: #78716c;
    --line: #e7e5e4;
    --soft: #f5f5f4;
    --accent: #B33A2B;
    --accent-soft: #c45c4a;
    --canyon: #0c0a09;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-rise { animation: none !important; opacity: 1 !important; }
    .stat-count { transition: none !important; }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: white;
    border-radius: 0 0 8px 0;
    font-size: 14px;
}

.skip-link:focus { left: 0; }

/* Nav — transparent over hero, solid when scrolled / light sections */
#nav {
    background: transparent;
    border-bottom: 1px solid transparent;
}

#nav.nav-scrolled {
    background: rgba(250, 249, 247, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: rgba(231, 229, 228, 0.8);
}

#nav.nav-scrolled .nav-brand,
#nav.nav-scrolled .nav-menu-icon {
    color: var(--ink) !important;
}

#nav.nav-scrolled .nav-links a {
    color: var(--mute);
}

#nav.nav-scrolled .nav-links a:hover {
    color: var(--ink);
}

#nav.nav-scrolled #mobile-menu {
    background: rgba(250, 249, 247, 0.98);
    border-color: var(--line);
}

#nav.nav-scrolled #mobile-menu .mobile-link {
    color: var(--ink);
}

/* Hero — Red Rock Canyon at sunset (light, not heavy dark) */
.hero-canyon {
    background-color: #c4785a;
    background-image: url('/images/hero-red-rock-sunset.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
}

.hero-canyon-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    /* Soft wash only — keep the sunset visible */
    background:
        linear-gradient(
            180deg,
            rgba(40, 24, 18, 0.22) 0%,
            rgba(40, 24, 18, 0.12) 35%,
            rgba(40, 24, 18, 0.28) 70%,
            rgba(28, 18, 14, 0.42) 100%
        );
}

.hero-title {
    color: #fff;
    text-shadow: 0 2px 24px rgba(40, 24, 18, 0.35);
}

.hero-title-muted {
    color: rgba(255, 255, 255, 0.88);
}

.hero-sub {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 12px rgba(40, 24, 18, 0.35);
}

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow-light {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(40, 24, 18, 0.3);
}

/* Frosted stats card on hero */
.stats-glass {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    padding: 22px 16px 24px;
    box-shadow: 0 12px 40px -12px rgba(40, 24, 18, 0.35);
}

@media (min-width: 640px) {
    .stats-glass {
        padding: 28px 12px 30px;
    }
}

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

.animate-rise {
    animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Buttons */
.cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border-radius: 980px;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.15s ease;
}

.cta-primary:hover { background: #000; }
.cta-primary:active { transform: scale(0.98); }

.cta-accent {
    background: var(--accent);
}
.cta-accent:hover { background: #9a3124; }

.cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border-radius: 980px;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--line);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cta-secondary:hover {
    background: var(--soft);
    border-color: #d6d3d1;
}

.cta-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border-radius: 980px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cta-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
}

/* Stats widget (on hero glass) */
.stat-card {
    padding: 0.35rem 1rem;
}

.stat-number {
    font-size: clamp(2.25rem, 5.5vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 16px rgba(40, 24, 18, 0.3);
}

.stat-prefix {
    font-weight: 600;
    letter-spacing: -0.04em;
}

.stat-count {
    display: inline-block;
    min-width: 0.5em;
}

.stat-label {
    margin-top: 0.55rem;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.98);
}

.stat-sub {
    margin-top: 0.25rem;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid rgba(231, 229, 228, 0.9);
    border-radius: 18px;
    padding: 26px 24px 28px;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -16px rgba(0, 0, 0, 0.12);
}

.icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: linear-gradient(180deg, #fff 0%, #faf0ed 100%);
    border: 1px solid rgba(179, 58, 43, 0.12);
}

/* Steps */
.step {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.step-last { border-bottom: 1px solid var(--line); }

.step-num {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--accent);
    padding-top: 3px;
    font-variant-numeric: tabular-nums;
}

/* Form */
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #a8a29e;
}

.field input:focus,
.field textarea:focus {
    border-color: #a8a29e;
    box-shadow: 0 0 0 4px rgba(28, 25, 23, 0.06);
}

/* Focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* ========== AI Agent ========== */
.ai-agent {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.ai-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 18px 0 16px;
    border-radius: 980px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 28px -6px rgba(179, 58, 43, 0.55), 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ai-fab:hover {
    background: #9a3124;
    transform: translateY(-1px);
}

.ai-fab:active { transform: scale(0.98); }

.ai-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-agent[data-open="true"] .ai-fab-label {
    display: none;
}

.ai-agent[data-open="true"] .ai-fab {
    width: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.ai-panel {
    width: min(380px, calc(100vw - 32px));
    height: min(520px, calc(100dvh - 120px));
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: panel-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--soft);
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-img {
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.ai-avatar img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.ai-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--mute);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ai-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink);
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.ai-msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

.ai-msg-bot {
    align-self: flex-start;
    background: var(--soft);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

.ai-msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-typing {
    align-self: flex-start;
    color: var(--mute);
    font-size: 13px;
    padding: 4px 2px;
}

.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ai-chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 980px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-chip:hover {
    background: var(--soft);
    border-color: #d6d3d1;
}

.ai-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.ai-form input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    background: var(--soft);
}

.ai-form input:focus {
    border-color: #d6d3d1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.08);
}

.ai-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ai-send:hover { background: #9a3124; }

@media (max-width: 480px) {
    .ai-agent {
        right: 12px;
        bottom: 12px;
    }
    .ai-panel {
        width: calc(100vw - 24px);
        height: min(70dvh, 520px);
    }
}
