:root {
  --primary: #2563eb; --accent: #f59e0b; --bg: #f8fafc; --text: #0f172a;
  --font: 'Cairo', system-ui, sans-serif;
  --surface: #ffffff; --card: var(--surface); --muted: color-mix(in srgb, var(--text) 55%, transparent);
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --soft: color-mix(in srgb, var(--primary) 8%, white);
  --radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .05);
  --ok: #16a34a; --err: #dc2626;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; padding: .65em 1.3em; border-radius: 10px; font-weight: 700; text-decoration: none;
  transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: #111; }
.btn.danger { background: var(--err); }
.btn.sm { padding: .35em .8em; font-size: .88rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.wa { background: #25d366; }

.field { display: flex; flex-direction: column; gap: .3em; margin-bottom: .9em; }
.field > span { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); }
.input, input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: .6em .8em; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { min-height: 90px; resize: vertical; }
.req::after { content: ' *'; color: var(--err); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.muted { color: var(--muted); }
.error-box { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: .8em 1em; border-radius: 10px; }
.info-box { background: var(--soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); padding: .8em 1em; border-radius: 10px; }
.loading { padding: 4rem 0; text-align: center; color: var(--muted); }
.loading::before { content: ''; display: block; width: 32px; height: 32px; margin: 0 auto 1rem; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: min(92vw, 420px); }
.toast { background: #0f172a; color: #fff; padding: .8em 1.1em; border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .25); animation: up .25s ease; transition: opacity .3s; }
.toast.err { background: var(--err); }
.toast.out { opacity: 0; }
.toast a { color: #fff; font-weight: 700; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }

.pill { display: inline-block; padding: .15em .7em; border-radius: 99px; font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap; }
.ph { display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, var(--soft), color-mix(in srgb, var(--accent) 18%, var(--surface))); aspect-ratio: 1; }
