/* Shared storefront shell for auth, account, thank-you, pluxee, and header framing. */

.app-bar {
    position: sticky;
    top: 16px;
    z-index: 50;
    padding: 0 24px 18px;
    background: transparent;
}

.app-bar__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 28px !important;
    box-shadow: var(--shadow-soft) !important;
}

.app-bar__brand-area {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 56px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.app-bar__brand {
    min-width: 0;
    min-height: 0;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none !important;
}

.app-bar__brand-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.app-bar__context {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.app-bar__context-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-bar__context-sub {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-bar__nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.app-bar__link {
    position: relative;
    min-height: 42px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px !important;
    background: transparent;
    box-shadow: none !important;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.app-bar__link:hover,
.app-bar__link.is-active {
    background: transparent;
    color: var(--text);
    border-color: transparent;
    transform: none;
}

.app-bar__link:last-child {
    padding: 0 18px;
    border: 1px solid rgba(19, 34, 53, 0.08);
    background: var(--surface-strong);
    color: #fff;
}

.app-bar__link:last-child:hover,
.app-bar__link:last-child.is-active {
    background: #0b1828;
    color: #fff;
    border-color: #0b1828;
}

.app-bar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px !important;
    background: rgba(19, 34, 53, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.app-bar__link:last-child .app-bar__badge {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.app-bar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.catalog-chip,
.wizard-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wizard-badge {
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--muted-strong);
}

.catalog-chip {
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--muted-strong);
}

body.auth-page {
    background: var(--bg);
}

.auth-shell {
    width: min(520px, 92vw);
    margin: var(--space-7) auto;
    padding: clamp(26px, 3vw, 34px);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 28px !important;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-soft) !important;
}

.auth-shell--wide {
    width: min(560px, 92vw);
}

.auth-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 96px;
}

.auth-logo img {
    display: block;
    width: auto;
    max-width: min(360px, 100%);
    max-height: 96px;
    object-fit: contain;
    border: 0;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.auth-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.04;
    letter-spacing: -.03em;
}

.auth-subtitle {
    margin: 0;
    max-width: 60ch;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.auth-alert {
    padding: 14px 16px;
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 18px !important;
    background: var(--surface-alt);
    color: var(--muted-strong);
    box-shadow: none !important;
    font-size: 14px;
}

.auth-alert.success {
    border-color: #98d8c7;
    background: var(--success-soft);
    color: var(--success);
}

.auth-alert.error {
    border-color: #f0b8b2;
    background: var(--danger-soft);
    color: var(--danger);
}

.auth-form {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-2);
}

.auth-form > div {
    display: block;
}

.auth-form label {
    margin-bottom: 6px;
}

.input-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
}

.auth-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.auth-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.auth-checkbox label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.auth-links--center {
    justify-content: center;
}

.auth-form .small,
.auth-shell .small {
    display: block;
    margin-top: -6px;
}

.wizard-shell {
    display: grid;
    gap: 26px;
}

.wizard-shell--compact {
    display: block;
}

.wizard-brand {
    width: 280px;
    min-height: 0;
    padding: 22px 24px;
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 24px !important;
    background: #fff;
    box-shadow: var(--shadow-soft) !important;
}

.wizard-brand img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 88px;
    height: auto;
    object-fit: contain;
}

.wizard-header {
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 28px !important;
    background: #fff;
    box-shadow: var(--shadow-soft) !important;
}

.wizard-header--simple,
.wizard-header--compact {
    padding: clamp(24px, 3vw, 34px);
}

.wizard-header h2 {
    margin: 10px 0 8px;
    max-width: 14ch;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.04em;
}

.wizard-header p {
    margin: 0;
    max-width: 62ch;
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

.wizard-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.step-card {
    padding: 28px 30px;
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 28px !important;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft) !important;
}

.step-card h3 {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.03em;
    text-transform: none;
}

.step-card .content {
    padding-top: 22px;
    border-top: 1px solid var(--divider);
}

.note {
    padding: 14px 16px;
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 18px !important;
    background: var(--surface-alt);
    color: var(--muted-strong);
    box-shadow: none !important;
}

.note--success {
    border-color: #98d8c7;
    background: var(--success-soft);
    color: var(--success);
}

.note--error {
    border-color: #f0b8b2;
    background: var(--danger-soft);
    color: var(--danger);
}

.note--warning {
    border-color: #efcf81;
    background: var(--warning-soft);
    color: var(--warning);
}

.form-error {
    margin-top: 8px;
    color: var(--danger);
}

.order-meta {
    margin-top: 6px;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wizard-actions__left,
.wizard-actions__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    background: transparent;
    font-size: 14px;
}

td,
th {
    padding: 16px;
    vertical-align: top;
    border-bottom: 1px solid var(--divider);
    overflow-wrap: anywhere;
}

tr:last-child td {
    border-bottom: 0;
}

thead th,
th {
    padding: 14px 16px;
    background: #f8f7f3;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.table-wrap {
    overflow: hidden;
    border: 1px solid rgba(19, 34, 53, 0.08);
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none !important;
}

.table-wrap table {
    background: #fff;
}

.table-wrap tbody tr:nth-child(even) td {
    background: #fafaf8;
}

.totals-grid {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-2) var(--space-4);
}

.thankyou-cards {
    display: grid;
    align-items: start;
    gap: 24px;
    margin-bottom: 24px;
}

.thankyou-cards .content {
    display: grid;
    gap: 14px;
}

.thankyou-highlight {
    padding: 18px 20px;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #111827 0%, #314156 100%);
    color: #fff;
    box-shadow: var(--shadow-xs) !important;
}

.thankyou-highlight strong {
    color: inherit;
}

@media (max-width: 980px) {
    .app-bar {
        padding: 0 16px 12px;
    }

    .app-bar__inner {
        padding: 12px 16px;
        border-radius: 22px !important;
    }

    .app-bar__brand {
        min-width: 0;
        min-height: 0;
    }

    .wizard-shell {
        gap: 20px;
    }

    .wizard-header,
    .step-card,
    .auth-shell {
        border-radius: 22px !important;
    }

    .wizard-brand {
        width: 190px;
    }
}

@media (max-width: 860px) {
    .table-wrap {
        border-radius: 18px !important;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap table {
        width: 100%;
        border: 0;
    }

    .table-wrap tbody tr {
        display: block;
        margin-bottom: var(--space-3);
        padding: var(--space-3);
        border: 1px solid var(--border);
        border-radius: 18px !important;
        background: #fff;
        box-shadow: var(--shadow-xs) !important;
    }

    .table-wrap tbody td {
        display: flex;
        justify-content: space-between;
        gap: var(--space-3);
        padding: 8px 0;
        border: 0;
    }

    .table-wrap tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        flex: 0 0 auto;
        padding-right: var(--space-3);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
}

@media (max-width: 720px) {
    .app-bar__inner {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .app-bar__brand-area {
        order: 1;
        flex: 1 1 auto;
    }

    .app-bar__actions {
        order: 2;
        margin-left: auto;
    }

    .app-bar__nav {
        order: 3;
        margin-left: 0;
        width: 100%;
    }

    .app-bar__context-sub {
        display: none;
    }

    .app-bar__brand {
        padding: 2px 0;
    }

    .app-bar__link {
        padding: 0 12px;
        font-size: 12px;
    }

    .app-bar__brand-image {
        max-width: 188px;
        max-height: 38px;
    }

    .app-bar__link {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .app-bar__link:last-child {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .app-bar__brand {
        font-size: 18px;
    }

    .wizard-brand {
        width: 210px;
        padding: 16px 18px;
    }

    .wizard-header h2,
    .auth-title {
        max-width: none;
        font-size: clamp(26px, 8vw, 38px);
    }

    .step-card,
    .wizard-header {
        padding: 20px;
    }

    .step-card h3 {
        font-size: 22px;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        margin: var(--space-6) auto;
        padding: var(--space-5);
    }
}

@media (max-width: 420px) {
    .app-bar__link {
        flex: 1 1 100%;
    }
}
