/* ── Milo Concierge — Full-screen welcome + persistent topbar ─── */

:root {
    --milo-primary: #00A7E1;
    --milo-primary-dark: #0088b8;
    --milo-bg: #ffffff;
    --milo-text: #1a1a2e;
    --milo-text-light: #6b7280;
    --milo-radius: 16px;
    --milo-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ── Concierge Container ── */

.epai-milo-concierge {
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    pointer-events: none;
}

/* ── Full-Screen Welcome Overlay ── */

.epai-milo__welcome {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #121230 50%, #0d1b2a 100%);
    pointer-events: all;
    animation: miloFadeIn 0.5s ease;
    z-index: 100001;
}

.epai-milo__welcome--exit {
    animation: miloFadeOut 0.3s ease forwards;
}

@keyframes miloFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes miloFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ── Welcome Card ── */

.epai-milo__welcome-card {
    background: var(--milo-bg);
    border-radius: 20px;
    padding: 48px 40px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: miloCardUp 0.6s ease 0.1s both;
    position: relative;
}

@keyframes miloCardUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Avatar ── */

.epai-milo__welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--milo-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(0, 167, 225, 0.3);
}

/* ── Heading / Subtext ── */

.epai-milo__welcome-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--milo-text);
    margin: 0 0 8px;
}

.epai-milo__welcome-subtext {
    font-size: 15px;
    color: var(--milo-text-light);
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Welcome Buttons ── */

.epai-milo__welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.epai-milo__welcome-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.epai-milo__welcome-btn--primary {
    background: var(--milo-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 167, 225, 0.25);
}

.epai-milo__welcome-btn--primary:hover {
    background: var(--milo-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 167, 225, 0.35);
}

.epai-milo__welcome-btn--ghost {
    background: transparent;
    color: var(--milo-text-light);
    border: 1px solid #d1d5db;
}

.epai-milo__welcome-btn--ghost:hover {
    border-color: var(--milo-primary);
    color: var(--milo-primary);
}

/* ── Quick Category Links ── */

.epai-milo__welcome-quicklinks {
    margin-top: 48px;
    text-align: center;
    animation: miloCardUp 0.6s ease 0.3s both;
}

.epai-milo__welcome-or {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.epai-milo__quick-cats {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.epai-milo__quick-cat {
    padding: 8px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.epai-milo__quick-cat:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.epai-milo__quick-cat--all {
    background: rgba(0, 167, 225, 0.15);
    border-color: rgba(0, 167, 225, 0.3);
    color: rgba(0, 167, 225, 0.9);
}

.epai-milo__quick-cat--all:hover {
    background: rgba(0, 167, 225, 0.25);
    border-color: rgba(0, 167, 225, 0.5);
    color: var(--milo-primary);
}

/* ── Step Content (inside card) ── */

.epai-milo__step-content {
    text-align: center;
}

.epai-milo__step-input-wrap {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.epai-milo__step-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    color: var(--milo-text);
}

.epai-milo__step-input:focus {
    border-color: var(--milo-primary);
}

.epai-milo__step-input::placeholder {
    color: #9ca3af;
}

.epai-milo__step-submit {
    flex-shrink: 0;
}

.epai-milo__step-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.epai-milo__step-error {
    color: #ef4444;
    font-size: 13px;
    margin: 0;
}

/* ── Upload ── */

.epai-milo__upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--milo-text-light);
    transition: all 0.2s;
}

.epai-milo__upload-label:hover {
    border-color: var(--milo-primary);
    color: var(--milo-primary);
}

.epai-milo__upload-input {
    display: none;
}

/* ── Spinner ── */

.epai-milo__spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.epai-milo__spinner p {
    color: var(--milo-text-light);
    margin: 0;
    font-size: 14px;
}

.epai-milo__spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--milo-primary);
    border-radius: 50%;
    animation: miloSpin 0.8s linear infinite;
}

@keyframes miloSpin {
    to { transform: rotate(360deg); }
}

/* ── Logo Preview ── */

.epai-milo__logo-preview {
    padding: 20px;
    text-align: center;
    animation: miloFadeIn 0.4s ease;
}

.epai-milo__logo-preview img {
    max-width: 180px;
    max-height: 130px;
    object-fit: contain;
    border-radius: 10px;
    background: #f5f5f5;
    padding: 12px;
}

/* ── Brand Summary ── */

.epai-milo__brand-summary {
    padding: 20px;
    text-align: center;
    animation: miloFadeIn 0.4s ease;
}

.epai-milo__brand-logo-wrap {
    margin-bottom: 12px;
}

.epai-milo__brand-logo-wrap img {
    max-width: 140px;
    max-height: 80px;
    object-fit: contain;
}

.epai-milo__brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--milo-text);
    margin: 8px 0;
}

.epai-milo__palette {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.epai-milo__color-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: help;
    transition: transform 0.2s;
}

.epai-milo__color-dot:hover {
    transform: scale(1.15);
}

.epai-milo__match-count {
    font-size: 14px;
    color: var(--milo-primary);
    font-weight: 600;
    margin: 12px 0 0;
}

/* ── Persistent Topbar ── */

.epai-milo__topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 48px;
    background: linear-gradient(135deg, #0a0a1a, #1a1a3a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 6px 20px 4px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    animation: miloSlideDown 0.3s ease;
}

@keyframes miloSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.epai-milo__topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epai-milo__topbar-logo {
    height: 28px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.epai-milo__topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--milo-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.epai-milo__topbar-company {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.epai-milo__topbar-msg {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.epai-milo__topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epai-milo__topbar-btn {
    padding: 6px 16px;
    border-radius: 8px;
    background: var(--milo-primary);
    color: white;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.epai-milo__topbar-btn:hover {
    background: var(--milo-primary-dark);
}

/* Topbar disclaimer line */
.epai-milo__topbar-disclaimer {
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, .5);
    padding: 2px 0 0;
    letter-spacing: .02em;
}

/* Push page content down when topbar is showing */
.epai-milo__topbar ~ .epai-magazine,
.epai-milo__topbar ~ main,
.epai-milo__topbar ~ .site-content {
    margin-top: 56px;
}

/* ── Brand Match Badge (on catalog cards) ── */

.epai-brand-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--milo-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
}

.epai-brand-match {
    outline: 2px solid var(--milo-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Mobile Responsive ── */

@media (max-width: 640px) {
    .epai-milo__welcome-card {
        padding: 32px 24px 28px;
        max-width: 100%;
        width: 92%;
        border-radius: 16px;
    }

    .epai-milo__welcome-heading {
        font-size: 22px;
    }

    .epai-milo__welcome-actions {
        flex-direction: column;
    }

    .epai-milo__welcome-btn {
        width: 100%;
    }

    .epai-milo__welcome-quicklinks {
        margin-top: 32px;
        padding: 0 12px;
    }

    .epai-milo__quick-cats {
        gap: 8px;
    }

    .epai-milo__quick-cat {
        padding: 6px 14px;
        font-size: 12px;
    }

    .epai-milo__step-input-wrap {
        flex-direction: column;
    }

    .epai-milo__step-submit {
        width: 100%;
    }

    .epai-milo__topbar {
        padding: 0 12px;
    }

    .epai-milo__topbar-msg {
        display: none;
    }

    .epai-milo__topbar-company {
        font-size: 13px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
