/* ─── Overlay ───────────────────────────────────────────────────────────────
   FIX: Use visibility + opacity instead of display:none so transitions work.
   FIX: pointer-events:none when closed so it doesn't block page clicks.
   The overlay is always display:flex — opacity/visibility control visibility.
   ─────────────────────────────────────────────────────────────────────────── */
.gruve-rh-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 12, 20, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999998;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.gruve-rh-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ─── Modal ─────────────────────────────────────────────────────────────────
   FIX: Remove opacity:0 initial state on the modal itself — the overlay
   already fades in, double-fading the modal made it invisible during entry.
   Keep the transform slide-up: it now animates correctly because the overlay
   transition and modal transition run simultaneously.
   ─────────────────────────────────────────────────────────────────────────── */
.gruve-rh-modal {
    width: 100%; max-width: 800px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden; position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    display: grid; grid-template-columns: 280px 1fr;
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
/* FIX: Delay modal animation slightly so it plays after overlay fades in */
.gruve-rh-overlay.is-open .gruve-rh-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
    transition-delay: 0.05s;
}

/* ─── Accent bar ─────────────────────────────────────────────────────────── */
.gruve-rh-accent-bar {
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: #EE0000; z-index: 2;
}

/* ─── Close button ───────────────────────────────────────────────────────── */
.gruve-rh-close {
    position: absolute; top: 14px; right: 14px;
    width: 34px; height: 34px; border-radius: 999px;
    background: #F7F6F1; border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 5;
    transition: transform 0.25s ease, background 0.2s ease;
    padding: 0; line-height: 0;
}
.gruve-rh-close:hover { background: #ECEAE0; transform: rotate(90deg); }
.gruve-rh-close svg { width: 16px; height: 16px; stroke: #0F1419; }

/* ─── Left panel ─────────────────────────────────────────────────────────── */
.gruve-rh-left {
    background: #FAFAF7;
    padding: 44px 28px 32px;
    display: flex; flex-direction: column; justify-content: space-between;
    border-right: 1px solid rgba(15, 20, 25, 0.08);
    position: relative; min-height: 100%;
}
.gruve-rh-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(238, 0, 0, 0.1);
    padding: 6px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 600; color: #C81010;
    letter-spacing: 0.6px; text-transform: uppercase;
    margin-bottom: 28px; width: fit-content;
}
.gruve-rh-pill-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #EE0000;
    animation: gruve-rh-pulse 1.8s ease-in-out infinite;
}
@keyframes gruve-rh-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}
.gruve-rh-logo {
    width: 100%; max-width: 180px; height: auto;
    display: block; margin-bottom: 24px;
}

/* ─── Meta items ─────────────────────────────────────────────────────────── */
.gruve-rh-meta-item {
    display: flex; align-items: flex-start;
    gap: 8px; font-size: 14px; color: #5F5E5A;
    line-height: 1.5; margin-bottom: 8px;
}
.gruve-rh-meta-item:last-child { margin-bottom: 0; }
.gruve-rh-meta-item svg {
    width: 16px; height: 16px; stroke: #EE0000;
    flex-shrink: 0; margin-top: 2px;
}
.gruve-rh-meta-strong { font-weight: 600; color: #0F1419; font-size: 14px; }

/* ─── Right panel ────────────────────────────────────────────────────────── */
.gruve-rh-right {
    padding: 44px 32px 32px;
    display: flex; flex-direction: column; justify-content: center;
}
.gruve-rh-eyebrow {
    font-size: 11px; letter-spacing: 1.8px;
    color: #6B6B6B; text-transform: uppercase;
    margin-bottom: 10px; font-weight: 600;
}
.gruve-rh-title {
    font-size: 24px; line-height: 1.2;
    margin: 0 0 10px; color: #0F1419;
    font-weight: 700; letter-spacing: -0.4px;
}
.gruve-rh-subtitle {
    font-size: 13.5px; color: #5F5E5A; line-height: 1.6;
    margin: 0 0 20px;
}

/* ─── CTA row ────────────────────────────────────────────────────────────── */
.gruve-rh-cta-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 20px;
}
.gruve-rh-cta {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 13px 12px;
    border-radius: 10px; text-decoration: none;
    font-weight: 600; font-size: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer; text-align: center; line-height: 1.2;
}
.gruve-rh-cta svg { width: 16px; height: 16px; flex-shrink: 0; }

.gruve-rh-cta-primary {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}
.gruve-rh-cta-primary svg { stroke: #fff; }
.gruve-rh-cta-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #000;
    transform: translateY(-1px);
}
a.gruve-rh-cta-primary:hover svg { stroke: #000; }

.gruve-rh-cta-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid rgba(15, 20, 25, 0.2);
}
.gruve-rh-cta-secondary svg { stroke: var(--primary-color); }
/* FIX: Replace undefined var(--text-color) with a real value */
.gruve-rh-cta-secondary:hover {
    background: #0F1419;
    border-color: #0F1419;
    color: #ffffff;
    transform: translateY(-1px);
}
.gruve-rh-cta-secondary:hover svg { stroke: #ffffff; }

/* ─── Form section ───────────────────────────────────────────────────────── */
.gruve-rh-form-section {
    padding-top: 16px;
    border-top: 1px dashed rgba(15, 20, 25, 0.15);
}
.gruve-rh-form-label {
    font-size: 11px; letter-spacing: 1.2px;
    color: #888780; text-transform: uppercase;
    margin-bottom: 10px; font-weight: 600;
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .gruve-rh-overlay { padding: 12px; align-items: flex-start; overflow-y: auto; }
    .gruve-rh-modal {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 24px);
        overflow-y: auto; margin: 12px 0;
    }
    .gruve-rh-left {
        padding: 32px 22px 22px;
        border-right: none;
        border-bottom: 1px solid rgba(15, 20, 25, 0.08);
        min-height: auto;
    }
    .gruve-rh-logo { max-width: 150px; margin-bottom: 18px; }
    .gruve-rh-pill { margin-bottom: 18px; }
    .gruve-rh-right { padding: 28px 22px 26px; }
    .gruve-rh-title { font-size: 22px; }
    .gruve-rh-cta-row { grid-template-columns: 1fr; }
}