/* ============================================================
   MBM Guest Order Lookup Page  —  mbm-guest-lookup.css
   Scoped entirely under .mbm-lookup-page
   ============================================================ */

/* Hide the default theme page H1 — this CSS only loads on the lookup page */
h1.page-title {
    display: none !important;
}

/* ---------- Page wrapper ---------- */
.mbm-lookup-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    font-family: inherit;
    color: #1a1a2e;
}

/* ---------- Hero ---------- */
.mbm-lookup-hero {
    text-align: center;
    margin-bottom: 28px;
}
.mbm-lookup-hero-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    color: #c8872a;
}
.mbm-lookup-hero-icon svg {
    width: 60px;
    height: 60px;
}
.mbm-lookup-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a1a2e;
}
.mbm-lookup-subtitle {
    font-size: 1rem;
    color: #555;
    margin: 0 0 8px;
}
.mbm-lookup-no-login {
    display: inline-block;
    font-weight: 600;
    color: #c8872a;
    font-size: 1rem;
    margin-bottom: 10px;
}
.mbm-lookup-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}
.mbm-lookup-privacy svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #888;
}

/* ---------- Cards ---------- */
.mbm-lookup-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    padding: 28px 28px 24px;
    margin-bottom: 20px;
}

/* ---------- Form grid ---------- */
/* Desktop (>720px): code | phone | button side-by-side */
.mbm-lookup-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: start;
}
/* Tablet + mobile (<720px): code + phone on one row, button full-width below */
@media (max-width: 720px) {
    .mbm-lookup-form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 16px;
    }
    .mbm-lookup-action {
        grid-column: 1 / -1;
        padding-top: 0;
        flex-direction: column;
        gap: 8px;
    }
    .mbm-lookup-btn {
        width: 100%;
    }
}
/* Small mobile (<520px): single column */
@media (max-width: 520px) {
    .mbm-lookup-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ---------- Labels & inputs ---------- */
.mbm-lookup-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #1a1a2e;
}
.mbm-info-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e8e8e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #666;
    cursor: default;
}
.mbm-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.mbm-input-icon {
    position: absolute;
    left: 13px;
    color: #aaa;
    display: flex;
    align-items: center;
}
.mbm-input-icon svg {
    width: 17px;
    height: 17px;
}
.mbm-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .2s;
    background: #fff;
    box-sizing: border-box;
    color: #1a1a2e;
    font-family: inherit;
}
.mbm-input::placeholder {
    color: #bbb;
    letter-spacing: .5px;
}
.mbm-input:focus {
    border-color: #c8872a;
    box-shadow: 0 0 0 3px rgba(200,135,42,.1);
}
#ipw_token.mbm-input {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}
.mbm-field-hint {
    margin: 6px 0 8px;
    font-size: 0.78rem;
    color: #888;
    line-height: 1.4;
}
.mbm-tip-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f7ee;
    color: #2a7a4a;
    font-size: 0.775rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.mbm-tip-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ---------- Access button ---------- */
/* Base: vertical stack (button + Secure label) in the 3rd grid column */
.mbm-lookup-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 26px;
}
.mbm-lookup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #c8872a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .1s;
    width: 100%;
}
.mbm-lookup-btn svg {
    width: 18px;
    height: 18px;
}
.mbm-lookup-btn:hover {
    background: #a96e1d;
}
.mbm-lookup-btn:active {
    transform: scale(.98);
}
.mbm-lookup-btn:disabled {
    opacity: .7;
    cursor: wait;
}
.mbm-secure-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #2a7a4a;
    font-weight: 500;
    white-space: nowrap;
}
.mbm-secure-label svg {
    width: 13px;
    height: 13px;
}

/* ---------- Result card — top row ---------- */
.mbm-result-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}
.mbm-result-check {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2db84d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mbm-result-check svg {
    width: 22px;
    height: 22px;
    color: #fff;
}
.mbm-result-status {
    flex: 1;
    min-width: 0;
}
.mbm-result-status strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}
.mbm-result-status p {
    margin: 2px 0 0;
    font-size: 0.83rem;
    color: #666;
}
/* Stats: 3 equal columns on wide screens */
.mbm-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.mbm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7f7fb;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}
.mbm-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    flex-shrink: 0;
}
.mbm-stat-icon svg {
    width: 16px;
    height: 16px;
}
.mbm-stat-icon--package   { background: #ede9fb; color: #7c5cbf; }
.mbm-stat-icon--edits     { background: #e5f3fd; color: #2677b8; }
.mbm-stat-icon--downloads { background: #e5f3fd; color: #2677b8; }
.mbm-stat-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mbm-stat-label {
    font-size: 0.7rem;
    color: #888;
    line-height: 1.3;
    margin-bottom: 4px;
}
.mbm-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}
/* Narrow screens: stats stack as rows (icon | label + value) */
@media (max-width: 520px) {
    .mbm-result-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mbm-stat {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        text-align: left;
    }
    .mbm-stat-icon {
        margin-bottom: 0;
    }
    .mbm-stat-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .mbm-stat-label {
        margin-bottom: 1px;
    }
    .mbm-stat-value {
        font-size: 0.95rem;
    }
}

/* ---------- Info box ---------- */
.mbm-result-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fdf6ec;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #6b4c1e;
    line-height: 1.5;
    margin-bottom: 20px;
}
.mbm-result-info svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #c8872a;
}

/* ---------- Action buttons ---------- */
.mbm-result-actions {
    display: flex;
    gap: 12px;
}
.mbm-btn-edit,
.mbm-btn-download {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 2px solid #c8872a;
}
.mbm-btn-edit {
    background: #c8872a;
    color: #fff;
}
.mbm-btn-edit:hover { background: #a96e1d; border-color: #a96e1d; }
.mbm-btn-download {
    background: #fff;
    color: #c8872a;
}
.mbm-btn-download:hover { background: #fdf3e5; }
.mbm-btn-edit svg,
.mbm-btn-download svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}
.mbm-btn-edit:disabled,
.mbm-btn-download:disabled {
    opacity: .65;
    cursor: wait;
}
@media (max-width: 520px) {
    .mbm-result-actions {
        flex-direction: column;
    }
}

/* ---------- Error card ---------- */
.mbm-error-card {
    border-left: 4px solid #e53935;
}
.mbm-error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c62828;
    font-weight: 500;
    font-size: 0.95rem;
}
.mbm-error-content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ---------- Help card ---------- */
.mbm-help-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.mbm-help-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff3e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #c8872a;
}
.mbm-help-icon svg { width: 24px; height: 24px; }
.mbm-help-text {
    flex: 1;
}
.mbm-help-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
}
.mbm-help-text p {
    margin: 3px 0 0;
    font-size: 0.83rem;
    color: #888;
}
.mbm-help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f7ee;
    color: #1a7a3a;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.mbm-help-link:hover { background: #cff0da; color: #1a7a3a; }
.mbm-help-link svg { width: 20px; height: 20px; }
.mbm-help-link span {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    color: #2a7a4a;
    margin-top: 1px;
}

/* ---------- Spinner for download loading state ---------- */
@keyframes mbm-spin {
    to { transform: rotate(360deg); }
}
.mbm-spin {
    display: inline-block;
    width: 17px;
    height: 17px;
    vertical-align: middle;
    animation: mbm-spin .8s linear infinite;
}

/* ---------- Mobile overrides ---------- */
@media (max-width: 600px) {
    .mbm-lookup-page {
        padding: 16px 12px 40px;
    }
    .mbm-lookup-hero {
        margin-bottom: 20px;
    }
    .mbm-lookup-hero-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    .mbm-lookup-hero-icon svg {
        width: 48px;
        height: 48px;
    }
    .mbm-lookup-title {
        font-size: 1.45rem;
    }
    .mbm-lookup-subtitle {
        font-size: 0.9rem;
    }
    .mbm-lookup-card {
        padding: 20px 16px 18px;
        border-radius: 12px;
    }
    /* Shorten privacy text on mobile — keep short version via CSS trick */
    .mbm-lookup-privacy {
        font-size: 0.8rem;
    }
    .mbm-help-icon {
        width: 40px;
        height: 40px;
    }
    .mbm-help-link {
        width: 100%;
        justify-content: center;
    }
    .mbm-result-info {
        font-size: 0.82rem;
    }
}
