/* PriceKit server pages: one stylesheet for RTL and LTR (logical properties only), mobile first (specs/10 §11.3). */
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    --bg: #f4f6fb; --card: #ffffff; --text: #1f2633; --muted: #667085; --border: #d8dde8;
    --primary: #1d4ed8; --primary-text: #ffffff; --error: #b42318; --success-bg: #ecfdf3; --success-border: #6ccf96;
    --warning-bg: #fffaeb; --warning-border: #f2c46d; --error-bg: #fef3f2;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif; line-height: 1.6; }
.page { max-inline-size: 760px; margin-inline: auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-block-end: 16px; }
.card.narrow { max-inline-size: 460px; margin-inline: auto; }
h1 { font-size: 1.5rem; margin-block: 0 8px; }
h2 { font-size: 1.15rem; margin-block: 16px 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lang-switch { text-align: end; margin-block-end: 8px; }
.lang-switch a { color: var(--primary); text-decoration: none; }
label { display: block; margin-block: 10px; }
.field { margin-block-end: 16px; }
.field[hidden] { display: none; }
.field[data-disabled="1"] { opacity: .5; pointer-events: none; }
.field-label { font-weight: 700; margin-block-end: 4px; }
.required { color: var(--error); margin-inline-start: 2px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], textarea {
    display: block; inline-size: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: inherit;
}
input:focus, textarea:focus, button:focus, a:focus { outline: 3px solid #93b4f5; outline-offset: 1px; }
.with-unit { display: flex; gap: 8px; align-items: center; }
.with-unit .unit { color: var(--muted); white-space: nowrap; }
/* ▲/▼ of number fields (stepper.js, owner 2026-11-07) */
.with-unit .stepper { display: inline-flex; flex-direction: column; gap: 2px; flex: none; }
.with-unit .stepper button { min-height: 0; height: 19px; width: 32px; padding: 0; font-size: 9px; line-height: 1; border-radius: 6px; }
.with-unit .stepper button:disabled { opacity: .45; cursor: default; }
.options { display: grid; gap: 6px; }
.option, .check { display: flex; gap: 8px; align-items: center; margin: 0; cursor: pointer; }
.option input, .check input { inline-size: 18px; block-size: 18px; flex: none; }
.option-price { color: var(--muted); font-weight: 700; margin-inline-start: auto; unicode-bidi: isolate; }
.option-price:empty { display: none; }
.field-error { color: var(--error); font-size: .875rem; margin-block: 4px 0; }
.has-error input, .has-error textarea { border-color: var(--error); }
button, .button { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 10px 18px; font: inherit; cursor: pointer; background: #fff; color: var(--text); text-decoration: none; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 700; }
button.secondary { background: #fff; }
button.link { border: 0; background: none; color: var(--primary); padding: 0; }
button[disabled] { opacity: .6; cursor: default; }
.notice { border-radius: 8px; padding: 10px 14px; margin-block: 10px; }
.notice.success { background: var(--success-bg); border: 1px solid var(--success-border); }
.notice.warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.notice.error { background: var(--error-bg); border: 1px solid var(--error); color: var(--error); }
.notice[hidden], [hidden] { display: none !important; }
.price-area { margin-block: 20px; }
#price-total { font-size: 1.4rem; }
fieldset.contact { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-block: 20px; }
fieldset.contact legend { font-weight: 700; padding-inline: 6px; }
.hp { position: absolute; inset-inline-start: -10000px; inline-size: 1px; block-size: 1px; overflow: hidden; }
dl.answers { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 16px; }
dl.answers dt { color: var(--muted); }
dl.answers dd { margin: 0; font-weight: 700; }
@media (max-width: 480px) {
    .page { padding: 8px; }
    .card { padding: 14px; border-radius: 10px; }
    dl.answers { grid-template-columns: 1fr; }
    dl.answers dd { margin-block-end: 8px; }
}

.button-link { display: inline-block; padding: 10px 18px; border-radius: 8px; background: #1d4ed8; color: #fff; font-weight: 700; text-decoration: none; }
.captcha-box { margin-block: 12px; min-block-size: 65px; }
.top-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 8px; }
.top-line .lang-switch { margin: 0; margin-inline-start: auto; }
.back-to-app { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 6px; background: #1d4ed8; color: #fff; font-weight: 600; text-decoration: none; }
.back-to-app:hover { background: #1e40af; }
.current-browser { border-inline-start: 3px solid #15803d; padding-inline-start: 10px; }
.brand-line { font-weight: 700; font-size: 1.15rem; color: var(--primary); text-decoration: none; }
/* Account management (AD-4): device list */
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { padding: 10px 0; border-block-end: 1px solid #e2e7f0; }
form.inline { display: inline-block; margin-block-start: 6px; }
.small { font-size: 13px; }

/* ---------- admin panel (AD-4, DECISION_REGISTER §Q14) ---------- */
.page.wide { max-inline-size: 1200px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding-block: 8px 14px; border-block-end: 1px solid var(--border); margin-block-end: 16px; }
.admin-nav a { color: var(--text); text-decoration: none; padding: 4px 2px; }
.admin-nav a.current { font-weight: 700; border-block-end: 2px solid var(--primary); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-block-end: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; }
.tile strong { font-size: 1.6em; }
.table-wrap { overflow-x: auto; margin-block-end: 16px; }
.admin-table { inline-size: 100%; border-collapse: collapse; background: var(--card); font-size: .92em; }
.admin-table th, .admin-table td { padding: 8px 10px; border-block-end: 1px solid var(--border); text-align: start; vertical-align: top; }
.admin-table th { background: #f6f7f9; font-weight: 600; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-block-end: 12px; }
.filters label { margin: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted, #666); }
.kv dd { margin: 0; }
.state { padding: 2px 8px; border-radius: 999px; font-size: .9em; border: 1px solid var(--border); white-space: nowrap; }
.state.trial { background: #eef4ff; }
.state.paid { background: #ecfdf3; }
.state.expired { background: #fef3f2; }
.state.locked { background: #fffaeb; }
.danger-zone { border-color: #f1b5ad; }
button.danger, .button.danger { background: #b42318; border-color: #b42318; color: #fff; font-weight: 700; }
button.small, .button.small { padding: 4px 10px; font-size: .9em; }
input[type=number], input[type=url], input[type=datetime-local], select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; max-inline-size: 100%; }
label > input[type=number], label > input[type=url], label > input[type=datetime-local] { display: block; inline-size: 100%; margin-block-start: 4px; box-sizing: border-box; }
code.key { display: inline-block; padding: 6px 10px; background: #f6f7f9; border-radius: 6px; word-break: break-all; font-size: 1.05em; letter-spacing: .04em; }
.qr img { border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.small { font-size: .9em; }
.secret-row { border-block-start: 1px solid var(--border); padding-block-start: 10px; margin-block-start: 10px; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; padding: 0; list-style: none; }
/* "Continue with Google" as on other sites (Google's sign-in branding): white, grey outline, the colour "G" at the start. */
.external-sign-in { margin-block: 4px; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 16px;
    background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 8px; font-weight: 700; }
.google-button:hover { background: #f7f8fa; box-shadow: 0 1px 3px rgba(60, 64, 67, .25); }
.google-mark { width: 18px; height: 18px; flex: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
/* "About PriceKit" on the sign-up page: a line, then a folded section that opens on click. */
hr.divider { border: 0; border-block-start: 1px solid var(--border); margin-block: 20px 12px; }
.about-accordion { border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; }
.about-accordion summary { cursor: pointer; font-weight: 700; padding-block: 12px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.about-accordion summary::-webkit-details-marker { display: none; }
.about-accordion summary::after { content: "+"; font-size: 1.3em; line-height: 1; color: var(--primary); }
.about-accordion[open] summary::after { content: "\2212"; }
.about-accordion[open] { padding-block-end: 8px; }
.about-accordion ul { padding-inline-start: 20px; }
/* Sign-in / sign-up tabs at the top of the card (owner, 2026-11-06): the open page is the raised, coloured tab. */
.auth-tabs { display: flex; gap: 4px; padding: 4px; margin-block-end: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.auth-tabs a { flex: 1; text-align: center; padding: 10px 12px; border-radius: 8px; font-weight: 700; color: var(--muted); text-decoration: none; }
.auth-tabs a:hover { color: var(--text); }
.auth-tabs a[aria-current="page"] { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, .15); }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.button:hover, button:not(.primary):not(.google-button):hover { background: #f7f8fa; }
.card .actions { margin-block: 12px; }
/* "About PriceKit" text (light format) and its admin editor with live preview (DECISION_REGISTER §Q14). */
.about-text h3 { font-size: 1.05rem; margin-block: 14px 6px; }
.about-text ul { padding-inline-start: 20px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 6px; }
.editor-toolbar button { padding: 6px 12px; }
.about-editor textarea { font-family: inherit; line-height: 1.6; }
.about-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 4px 16px; margin-block-end: 12px; background: var(--bg); }
/* Website calculators (DECISION_REGISTER §S) */
body.embedded { background: transparent; }
body.embedded .page { padding: 0; }
body.embedded .top-line:empty { display: none; }
.powered-by { text-align: center; margin-block: 12px 0; }
.website-message { text-align: center; }
.notice.info { background: #eff4ff; border: 1px solid #b2c7f8; }
.site-chart { display: block; width: 100%; height: 140px; border-bottom: 1px solid var(--border); margin-block: 8px; }
/* Developer documentation (/developers) */
.docs h2 { margin-block-start: 1.6em; }
.docs pre { overflow: auto; background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.5; }
.docs code { font-family: Consolas, "Courier New", monospace; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 12px; }
/* Brand on the account and admin pages (owner 2026-11-09): the Professional icon and its green */
.brand-line { display: inline-flex; align-items: center; gap: 8px; color: #007850; font-weight: 800; }
.brand-line::before { content: ""; width: 24px; height: 24px; border-radius: 6px; background: url("/assets/icon-32.png") center / contain no-repeat; flex: none; }
/* Admin "Labels and texts" */
.text-row { padding-block: 12px; }
.text-row.changed { border-inline-start: 4px solid #007850; }
.text-row textarea { inline-size: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.text-row label { display: flex; flex-direction: column; gap: 4px; }
