.site-header + main:has(.auth-page) {
    display: grid;
    place-items: center;
}

.auth-page {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 32px 0;
}

.auth-form {
    display: grid;
    gap: 16px;
    width: min(380px, 100%);
}

.auth-unavailable {
    display: grid;
    justify-items: start;
    width: min(480px, 100%);
    padding: 36px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgb(15 46 56 / 8%);
}

.auth-unavailable__eyebrow {
    margin: 0 0 14px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-unavailable h1 {
    max-width: 390px;
    margin: 0;
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1.08;
}

.auth-unavailable__description {
    max-width: 400px;
    margin: 18px 0 26px;
    color: var(--color-muted);
    font-size: 16px;
    line-height: 1.6;
}

.auth-unavailable .button {
    min-width: 160px;
    color: #ffffff;
}

.auth-unavailable .button:hover {
    color: #ffffff;
    text-decoration: none;
}

.auth-form p {
    margin: 0;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-form h1 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.1;
}

.auth-form label {
    display: grid;
    gap: 8px;
}

.auth-form label span {
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font: inherit;
}

.auth-form input:focus {
    border-color: #99d5cb;
    outline: none;
}

.auth-form a {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-form a:hover {
    text-decoration: underline;
}

.auth-form .auth-error {
    margin: 0;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
}

.auth-form .auth-field-error {
    margin: 0;
    color: #dc2626;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    text-transform: none;
}

.auth-form .auth-field-error:empty {
    display: none;
}

.auth-success {
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #ecfdf5;
    color: #047857;
    font-size: 14px;
    font-weight: 700;
}

.account-page {
    padding-bottom: 64px;
}

.account-panel {
    max-width: 640px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    background: #f9fafb;
    position: relative;
}

.account-panel--wide {
    max-width: 820px;
}

.account-panel h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.account-panel p {
    margin: 0;
    color: var(--color-muted);
}

.account-details {
    display: grid;
    gap: 16px;
    margin: 20px 0 0;
}

.account-details div {
    display: grid;
    gap: 4px;
}

.account-details dt {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
}

.account-details dd {
    margin: 0;
    font-size: 20px;
    line-height: 1.35;
}

.account-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 28px;
}

.account-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.account-logout:hover {
    border-color: #fca5a5;
    background: #fee2e2;
}

.account-orders {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.account-order {
    display: grid;
    grid-template-columns: 1fr 96px 1fr;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
}

.account-order span {
    color: var(--color-muted);
    font-size: 14px;
}

.account-order span:nth-child(2) {
    justify-self: start;
    text-align: left;
}

.account-order span:first-child {
    color: var(--color-text);
    font-size: 16px;
}

.account-order small {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 13px;
}

.account-order strong {
    font-size: 15px;
}

.account-order__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.account-order__link {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.account-order__link:hover {
    text-decoration: underline;
}

.order-detail__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.order-detail__summary div {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #ffffff;
}

.order-detail__summary span {
    display: block;
    margin-bottom: 6px;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
}

.order-detail__summary strong {
    font-size: 18px;
    font-weight: 400;
}

.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dff5ef;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
}

.account-order .order-status,
.order-detail__summary .order-status {
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 400;
}

.account-order .order-status {
    justify-content: flex-start;
    min-height: 24px;
    padding: 0 12px;
    font-size: 14px;
}

.order-detail__section {
    margin-top: 24px;
}

.order-detail__section h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.order-detail__items {
    display: grid;
    gap: 10px;
}

.order-detail__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #ffffff;
}

.order-detail__item > div {
    display: grid;
    gap: 4px;
}

.order-detail__product {
    display: inline-block;
    margin: 0;
    color: var(--color-text);
    text-decoration: none;
}

.order-detail__product:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.order-detail__item span {
    display: block;
    color: var(--color-muted);
    font-size: 14px;
}

.order-detail__item strong {
    font-weight: 400;
    white-space: nowrap;
}

.order-detail__customer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 16px;
}

.logout-page {
    min-height: 58vh;
    display: grid;
    place-items: center;
    padding: 48px 0 72px;
}

.logout-panel {
    width: min(420px, 100%);
    text-align: center;
}

.logout-panel p {
    margin: 0 0 10px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.logout-panel h1 {
    margin: 0 0 12px;
    font-size: 38px;
    line-height: 1.08;
}

.logout-panel span {
    display: block;
    margin-bottom: 28px;
    color: var(--color-muted);
}

.logout-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.logout-actions form {
    margin: 0;
}

@media (max-width: 560px) {
    .auth-page {
        padding: 20px 0;
    }

    .auth-unavailable {
        padding: 26px 22px;
    }

    .auth-unavailable h1 {
        font-size: 32px;
    }

    .auth-unavailable .button {
        width: 100%;
    }

    .account-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-actions .button,
    .account-logout {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding-inline: 12px;
        white-space: nowrap;
    }

    .account-actions > :first-child:nth-last-child(2),
    .account-logout {
        grid-column: 1 / -1;
    }

    .checkout-success__actions {
        flex-direction: column;
        width: min(286px, 100%);
    }

    .checkout-success__actions .button {
        width: 100%;
        white-space: nowrap;
    }

    .order-detail__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .order-detail__summary div {
        padding: 14px;
    }

    .order-detail__summary div:nth-child(3) {
        grid-column: 1 / -1;
    }

    .order-detail__summary strong {
        font-size: 16px;
    }

    .order-detail__summary .order-status {
        min-height: 26px;
        padding: 0 10px;
        font-size: 14px;
    }

    .account-order {
        grid-template-columns: minmax(0, 1fr) 88px 68px;
        gap: 8px 10px;
        padding: 12px 14px;
    }

    .account-order > div:first-child {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }

    .account-order span:nth-child(2) {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: start;
        text-align: left;
    }

    .account-order__actions {
        display: contents;
    }

    .account-order__actions strong {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        justify-self: end;
    }

    .account-order__actions .account-order__link {
        grid-column: 3;
        grid-row: 2;
        align-self: center;
        justify-self: end;
    }

    .order-detail__customer-grid {
        grid-template-columns: 1fr;
    }

    .admin-detail-list dd {
        overflow-wrap: anywhere;
    }
}
