/* Customer account area theme.
   Loaded after admin.css + auth.css on the customer pages ONLY, so the
   staff admin panel and the login screens keep their own palette.
   Mirrors the public site: blue primary + one emerald accent. */

:root {
    --primary: #1e40af;   /* brand mark, primary buttons */
    --on-primary: #ffffff;
    --accent: #047857;    /* focus rings, active nav, links, form accents */
}

/* Login screen: match the emerald focus ring (auth.css hard-codes a blue glow). */
.auth-body .field input:focus { box-shadow: 0 0 0 3px rgba(4, 120, 87, .16); }

/* Customer account area: simple top bar, no sidebar. */

.acct-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: rgba(248, 250, 252, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.acct-top__brand { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; font-weight: 600; }
.acct-top__right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.acct-top__who { font-size: 13px; color: var(--muted-fg); }

.acct-wrap { max-width: 980px; margin: 0 auto; padding: var(--space-4); }

.acct-head { margin-bottom: var(--space-4); }
.acct-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.acct-head p { margin: 0; font-size: 14px; color: var(--muted-fg); }

@media (max-width: 600px) {
    .acct-top__who { display: none; }
    .acct-wrap { padding: var(--space-3); }
}

/* ---------- Order catalogue (Add license) ---------- */

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-3);
}

.order-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
}
.order-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.order-card__brand { display: flex; align-items: center; gap: 10px; height: 44px; margin-bottom: var(--space-3); }

.order-card__logo {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 11px;
    background: #e7f5ef;
    color: var(--accent);
}
.order-card__logo svg { width: 22px; height: 22px; }
.order-card__logo--img { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.order-card__logo--img img { width: 30px; height: 30px; object-fit: contain; display: block; }

.order-card__vendor { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }

.order-card__name { margin: 0 0 10px; font-size: 15px; font-weight: 600; line-height: 1.35; }

.order-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--space-3); }

.order-card__term {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--muted);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-fg);
}

.order-card__covers { font-size: 13px; color: var(--muted-fg); }

.order-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.order-card__pricing { display: flex; flex-direction: column; gap: 2px; }
.order-card__plabel { font-size: 12px; color: var(--muted-fg); }
.order-card__price { font-size: 24px; font-weight: 700; letter-spacing: -.03em; color: var(--accent); line-height: 1.1; }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--space-3); }
.modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal__scrim { position: absolute; inset: 0; background: rgba(2, 6, 23, .45); }

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.modal__title { margin: 0; font-size: 15px; font-weight: 600; }
.modal__head .iconbtn { margin-left: auto; }

.modal__body { padding: var(--space-3); }

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.order-summary {
    display: grid;
    gap: 2px;
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    background: var(--muted);
}
.order-summary__vendor { font-size: 12px; font-weight: 600; color: var(--muted-fg); }
.order-summary__name { font-size: 14px; font-weight: 600; }
.order-summary__price { font-size: 16px; font-weight: 700; color: var(--accent); }

/* Select styled to match the customer form inputs. */
.field__select {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--card);
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.field__select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(4, 120, 87, .15); }

.field__hint { margin: 6px 0 0; font-size: 12px; color: var(--muted-fg); }

/* ---------- Credit note variants & order cost ---------- */

.note--info { border-style: solid; border-color: #c7e0f2; background: #eef6fc; color: #075985; }
.note--bad { border-style: solid; border-color: #f5c8c8; background: #fdeaea; color: var(--danger); }
.note--info b { color: inherit; }

.order-cost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
}
.order-cost__value { font-size: 18px; font-weight: 700; color: var(--accent); }

.order-cost__warn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: var(--space-2) 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}
.order-cost__warn svg { width: 15px; height: 15px; flex: none; }

.order-summary__name { font-size: 14px; font-weight: 600; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- License detail ---------- */

.licdetail { overflow: hidden; }

.licdetail__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--primary);
    color: var(--on-primary);
}
.licdetail__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.licdetail__head .badge { margin-left: auto; }

.licdetail__rows { margin: 0; padding: var(--space-1) var(--space-3); }

.licdetail__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}
.licdetail__row + .licdetail__row { border-top: 1px solid var(--border); }
.licdetail__row dt { font-size: 13px; color: var(--muted-fg); }
.licdetail__row dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; }

.licdetail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}
.licdetail__actions form { margin: 0; }
