/**
 * File: demo/portal/assets/css/demo-tour.css
 * Purpose: Lightweight welcome, spotlight tour and completion styles for the
 * static customer-portal demo. Light mode only; no third-party tour library.
 */

#demo-tour-root {
    position: relative;
    z-index: 200;
}

#demo-tour-root * {
    box-sizing: border-box;
}

/* Demo Mode pill is also the tour restart control */
.demo-mode-pill--action {
    cursor: pointer;
}
.demo-mode-pill--action:hover {
    background: #FDE68A;
}
.demo-mode-pill--action:focus-visible {
    outline: 2px solid #465FFF;
    outline-offset: 2px;
}

/* Guided Tour launch button in the header */
.demo-tour-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.65rem;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: #FFFFFF;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.demo-tour-launch:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.demo-tour-launch:focus-visible {
    outline: 2px solid #465FFF;
    outline-offset: 2px;
}

.demo-tour-launch svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #465FFF;
}

@media (max-width: 639px) {
    .demo-tour-launch {
        width: 32px;
        height: 32px;
        padding: 0;
    }
    .demo-tour-launch__label {
        display: none;
    }
}

@media (max-width: 479px) {
    .header-wordmark {
        display: none;
    }
}

@media (max-width: 359px) {
    .demo-header-inner {
        padding-left: 6px;
        padding-right: 6px;
    }
    .demo-header-brand,
    .demo-header-actions {
        gap: 6px;
    }
}

/* ---------- Tour spotlight ---------- */
.demo-tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: transparent;
}

.demo-tour-shade {
    position: absolute;
    background: rgba(15, 23, 42, 0.55);
}

.demo-tour-spotlight {
    position: fixed;
    z-index: 101;
    pointer-events: none;
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.85),
        0 0 0 4px rgba(70, 95, 255, 0.28);
    transition: top 0.16s ease, left 0.16s ease, width 0.16s ease, height 0.16s ease;
}

/* ---------- Tour popup ---------- */
.demo-tour-popup {
    position: fixed;
    z-index: 102;
    width: 360px;
    max-width: calc(100vw - 24px);
    padding: 18px 18px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    animation: demo-tour-in 0.16s ease-out;
}

.demo-tour-popup--mobile {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 46vh;
    overflow-y: auto;
}

.demo-tour-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #465FFF;
}

.demo-tour-step-count {
    color: #6B7280;
    letter-spacing: 0.04em;
}

.demo-tour-progress {
    height: 4px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 9999px;
    background: #EEF2F7;
}

.demo-tour-progress__bar {
    height: 100%;
    border-radius: 9999px;
    background: #465FFF;
    transition: width 0.2s ease;
}

.demo-tour-popup h3 {
    margin: 12px 0 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}

.demo-tour-popup p {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #4B5563;
}

.demo-tour-popup .demo-tour-fallback {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    font-size: 12px;
    color: #6B7280;
    background: #F9FAFB;
}

.demo-tour-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.demo-tour-controls .demo-tour-exit {
    margin-right: auto;
}

.demo-tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.demo-tour-btn--primary {
    background: #465FFF;
    color: #FFFFFF;
}
.demo-tour-btn--primary:hover {
    background: #3D52E8;
}

.demo-tour-btn--secondary {
    border-color: #D1D5DB;
    background: #FFFFFF;
    color: #374151;
}
.demo-tour-btn--secondary:hover {
    background: #F9FAFB;
}

.demo-tour-btn--ghost {
    padding-left: 2px;
    padding-right: 2px;
    border-color: transparent;
    background: transparent;
    color: #6B7280;
}
.demo-tour-btn--ghost:hover {
    color: #111827;
    text-decoration: underline;
}

.demo-tour-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.demo-tour-btn:focus-visible,
.demo-tour-choice:focus-visible {
    outline: 2px solid #465FFF;
    outline-offset: 2px;
}

/* ---------- Welcome / completion / options modals ---------- */
.demo-tour-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.55);
}

.demo-tour-modal {
    width: 100%;
    max-width: 540px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.28);
    animation: demo-tour-in 0.18s ease-out;
}

.demo-tour-modal--compact {
    max-width: 440px;
    padding: 24px;
}

.demo-tour-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.demo-tour-brand img {
    width: 32px;
    height: 32px;
}

.demo-tour-brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.demo-tour-demo-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #FDE68A;
    border-radius: 9999px;
    padding: 3px 8px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
}

.demo-tour-demo-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #F59E0B;
}

.demo-tour-modal h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #111827;
}

.demo-tour-tagline {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #065F46;
}

.demo-tour-modal-copy {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.65;
    color: #4B5563;
}

.demo-tour-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.demo-tour-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.demo-tour-choice--primary {
    background: #465FFF;
    color: #FFFFFF;
}
.demo-tour-choice--primary:hover {
    background: #3D52E8;
}

.demo-tour-choice--secondary {
    border-color: #D1D5DB;
    background: #FFFFFF;
    color: #374151;
}
.demo-tour-choice--secondary:hover {
    background: #F9FAFB;
}

.demo-tour-choice-subtext {
    font-size: 11.5px;
    font-weight: 500;
    opacity: 0.85;
}

.demo-tour-modal-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #F3F4F6;
    font-size: 12px;
    line-height: 1.5;
    color: #6B7280;
    text-align: center;
}

.demo-tour-modal-hint {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6B7280;
}

.demo-tour-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

@keyframes demo-tour-in {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 639px) {
    .demo-tour-modal {
        padding: 22px;
        border-radius: 16px;
    }
    .demo-tour-modal h2 {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-tour-popup,
    .demo-tour-modal {
        animation: none;
    }
    .demo-tour-spotlight,
    .demo-tour-progress__bar {
        transition: none;
    }
}
