:root {
  --navy: #194185;
  --green: #47CD89;
  --deep: #0F2A57;
  --ink: #152238;
  --muted: #5a6779;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #dfe5ec;
  --shadow: 0 12px 40px rgba(21, 34, 56, .08);
}
:root[data-theme="dark"] {
  --ink: #e8eef6;
  --muted: #a9b6c7;
  --bg: #0d1625;
  --panel: #142033;
  --line: #26364d;
  --shadow: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.utility { background: var(--deep); color: #dbe7f7; font-size: .82rem; }
.utility-inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 1rem; }
.utility-actions { display: flex; align-items: center; gap: 1rem; }
.lang-form { display: flex; align-items: center; gap: .4rem; }
.lang-form select, .theme-toggle {
  background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px; padding: 3px 8px; font: inherit;
}
.lang-form select option { color: #152238; }
.theme-toggle { cursor: pointer; }

.site-header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); }
.brand img { height: 44px; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.3rem; letter-spacing: .06em; }
.brand small { color: var(--green); font-weight: 700; }
.site-header nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-header nav a.active { color: var(--navy); border-bottom-color: var(--green); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--green); color: #0b2a1c; font-weight: 800;
  border: 0; border-radius: 8px; padding: .85rem 1.4rem; cursor: pointer;
}
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-white { background: #fff; color: var(--navy); }

.messages { padding-top: 1rem; }
.notice { padding: .75rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); margin-bottom: .5rem; }
.notice.success { border-color: var(--green); }
.notice.error { border-color: #e07b7b; }

.hero {
  background: linear-gradient(135deg, var(--deep), var(--navy));
  color: #fff; padding: 5rem 0 4rem;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.12; margin: 0 0 1.1rem; }
.hero p { color: #cbd8ea; font-size: 1.1rem; max-width: 42rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 1.5rem; backdrop-filter: blur(4px); }
.hero-card h3 { margin-top: 0; color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin: -2.5rem auto 3rem; position: relative; padding: 1.5rem 0; box-shadow: var(--shadow); }
.stat { text-align: center; border-inline-end: 1px solid var(--line); }
.stat:last-child { border-inline-end: 0; }
.stat strong { display: block; font-size: 2.4rem; color: var(--navy); line-height: 1; }
.stat span { color: var(--muted); font-size: .9rem; }

.section { padding: 2.5rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { font-size: 1.9rem; margin: 0; color: var(--deep); }
.section-head p { color: var(--muted); margin: .25rem 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; }
.panel:hover { border-color: var(--green); }
.panel h3 { margin: .2rem 0 .6rem; }
.meta { color: var(--muted); font-size: .88rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 99px; background: rgba(71,205,137,.15); color: #176b43; font-size: .78rem; font-weight: 700; }
.pill.pending { background: rgba(25,65,133,.1); color: var(--navy); }
.pill.failed { background: rgba(224,123,123,.15); color: #9a2e2e; }

.page-band { background: var(--deep); color: #fff; padding: 2.8rem 0 2.4rem; }
.page-band h1 { margin: 0 0 .4rem; font-size: 2.2rem; }
.page-band p { color: #cbd8ea; margin: 0; }
.page-body { padding: 2.5rem 0 4rem; }

.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 70vh; }
.login-art { background: linear-gradient(160deg, var(--deep), var(--navy)); color: #fff; padding: 4rem 3rem; display: flex; flex-direction: column; justify-content: center; }
.login-art h1 { font-size: 2.6rem; margin: 1.5rem 0 .8rem; }
.login-art p { color: #cbd8ea; }
.login-form-side { display: grid; place-items: center; padding: 3rem 2rem; }
.login-card { width: min(420px, 100%); }
.login-card h1 { color: var(--deep); margin-bottom: .3rem; }
.login-card p { color: var(--muted); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: .9rem; }
.input, input[type="text"], input[type="password"], input[type="email"], select, textarea {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font: inherit;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: 2px solid rgba(71,205,137,.5); border-color: var(--green); }
.errorlist { color: #a32f2f; list-style: none; padding: 0; margin: .4rem 0 0; font-size: .85rem; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-align: start; font-size: .92rem; }
th { background: rgba(25,65,133,.06); color: var(--deep); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress span { display: block; height: 100%; background: var(--green); }

.q { border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; margin-bottom: 1rem; background: var(--panel); }
.q h3 { margin-top: 0; }
.q label { display: block; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin: .4rem 0; cursor: pointer; }
.q input { width: auto; margin-inline-end: .6rem; }

.certificate { max-width: 760px; margin: 0 auto; text-align: center; background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--green); border-radius: 12px; padding: 3rem 2rem; }
.certificate h1 { color: var(--navy); letter-spacing: .08em; }
.certificate .number { color: var(--muted); font-family: monospace; }

.site-footer { background: var(--deep); color: #cbd8ea; padding: 3rem 0 1rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; margin: 0 0 .8rem; }
.site-footer a { display: block; color: #cbd8ea; margin: .3rem 0; }
.footer-logo { height: 46px; margin-bottom: .8rem; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; font-size: .82rem; }

@media (max-width: 860px) {
  .hero-grid, .login-wrap, .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; margin-top: 0; }
  .stat { border-inline-end: 0; border-bottom: 1px solid var(--line); padding: .8rem 0; }
  .site-header nav { gap: .8rem; }
  .login-art { padding: 2.5rem 1.5rem; }
}
