/* Pūrlādes mājaslapa — tās pašas krāsas kā datora Pūrlādē un Kabatas Pūrlādē */
:root {
  --cream: #FFF8E7;
  --cream-dark: #F3E8CC;
  --red: #9E1B32;
  --red-dark: #7E1428;
  --red-tint: #F6D5DA;
  --navy: #1F2A44;
  --navy-soft: #3A4766;
  --gold: #C9A227;
  --gold-tint: #F6E3B0;
  --green: #1B6B3A;
  --green-tint: #CDE8D5;
  --white: #FFFFFF;
  --line: #E4D7B5;
  --text: #1F2A44;
  --muted: #5F6878;
  --shadow: 0 1px 2px rgba(31, 42, 68, .08), 0 6px 20px rgba(31, 42, 68, .07);
  --radius: 16px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* latvisku rakstu josla (rombu ornaments) */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16' viewBox='0 0 48 16'%3E%3Crect width='48' height='16' fill='%239E1B32'/%3E%3Cpath d='M12 2l6 6-6 6-6-6z' fill='%23FFF8E7'/%3E%3Cpath d='M12 5.5l2.5 2.5-2.5 2.5-2.5-2.5z' fill='%239E1B32'/%3E%3Cpath d='M36 4l4 4-4 4-4-4z' fill='%23C9A227'/%3E%3Cpath d='M0 8h4M20 8h8M44 8h4' stroke='%23FFF8E7' stroke-width='1.5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--cream); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: clamp(28px, 4vw, 38px); }
h3 { font-size: 21px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; color: var(--muted); }

/* ---- pogas ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid transparent; border-radius: 999px; padding: 11px 22px;
  font: 600 16px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .linkbtn:focus-visible, .choice:focus-visible, .nav a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.btn-red { background: var(--red); color: var(--cream); }
.btn-red:hover { background: var(--red-dark); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #D8B23A; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--cream); }
.btn-big { padding: 15px 34px; font-size: 18px; }
.btn-wide { width: 100%; padding: 13px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--red); font: 600 15px var(--sans);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- galvene ---- */
.top {
  position: sticky; top: 0; z-index: 30; background: var(--navy); color: var(--cream);
  border-bottom: 3px solid var(--gold);
}
.top-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none;
  font: 700 22px var(--serif); letter-spacing: .02em; }
.brand img { width: 42px; height: 42px; background: var(--cream); border-radius: 10px; padding: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--cream); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15.5px; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.users-btn { padding: 9px 18px; }

/* ---- sākums ---- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% 20%, rgba(201, 162, 39, .18), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, rgba(158, 27, 50, .08), transparent 60%),
    var(--cream);
  padding: 56px 0 36px;
}
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--red); margin: 0 0 8px; }
.hero h1 { font-size: clamp(52px, 8vw, 86px); margin: 0; letter-spacing: .01em; }
.tagline { font: italic 22px var(--serif); color: var(--navy-soft); margin: 4px 0 20px; }
.lead { font-size: 18.5px; max-width: 36em; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: grid; place-items: center; }
.hero-art img {
  width: min(400px, 100%); aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(31, 42, 68, .18));
}
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px;
}
.facts div {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column;
}
.facts b { font: 700 24px var(--serif); color: var(--red); }
.facts span { font-size: 14.5px; color: var(--muted); }

.band { height: 16px; background: var(--band) repeat-x; background-size: 48px 16px; }

/* ---- sadaļas ---- */
.sec { padding: 64px 0; }
.sec-alt { background: var(--cream-dark); }
.sec-lead { font-size: 18px; max-width: 46em; color: var(--navy-soft); margin: 0 0 28px; }
.sub-h { margin-top: 36px; }

.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.part, .card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.part p { margin: 0; color: var(--navy-soft); }
.part-ico { font-size: 30px; margin-bottom: 8px; }

.flow {
  margin: 30px 0 0; display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 18px;
}
.node {
  flex: 1 1 160px; border: 1px solid rgba(255, 248, 231, .25); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: center;
}
.node b { font-size: 16px; }
.node span { font-size: 13.5px; opacity: .75; }
.node-db { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.node-db span { opacity: .85; }
.arrow { align-self: center; font-size: 22px; color: var(--gold); }

/* ---- moduļi ---- */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mod {
  background: var(--white); border-radius: var(--radius); padding: 20px 22px 18px;
  border: 1px solid var(--line); border-top: 5px solid var(--c); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.mod header { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.mod header img { width: 68px; height: 68px; flex: none; }
.mod h3 { margin: 0; }
.ver {
  display: inline-block; margin-top: 3px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); padding: 2px 9px; border-radius: 999px;
}
.ver-soon { color: #7A5D00; background: var(--gold-tint); }
.mod-what { font-weight: 600; margin: 0 0 10px; }
.mod ul { margin: 0; padding-left: 0; list-style: none; font-size: 15.5px; color: var(--navy-soft); }
.mod li { padding: 5px 0 5px 18px; position: relative; border-top: 1px dashed var(--line); }
.mod li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 7px; height: 7px; background: var(--c);
  transform: rotate(45deg);
}
.mod-soon { opacity: .85; }
.admin-note {
  margin-top: 22px; background: var(--cream); border: 1px dashed var(--navy-soft); border-radius: var(--radius);
  padding: 16px 22px;
}
.admin-note h3 { font-size: 18px; margin-bottom: 4px; }
.admin-note p { margin: 0; color: var(--navy-soft); font-size: 15.5px; }

/* ---- Kabatas Pūrlāde ---- */
.kab-head { display: flex; gap: 20px; align-items: flex-start; }
.kab-head img { width: 84px; height: 84px; border-radius: 20px; flex: none; box-shadow: var(--shadow); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { padding: 7px 0 7px 28px; position: relative; border-top: 1px solid var(--line); font-size: 15.5px; }
.ticks li:first-child { border-top: 0; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--navy); color: var(--cream); font-weight: 600; border-top: 0; white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: #FFFCF3; }
.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.pill-green { background: var(--green-tint); color: var(--green); }
.pill-red { background: var(--red-tint); color: var(--red); }
.pill-gold { background: var(--gold-tint); color: #7A5D00; }
.pill-navy { background: #DCE1EC; color: var(--navy); }

/* ---- Lietotājiem ---- */
.users { background: var(--navy); color: var(--cream); }
.users h2 { color: var(--cream); }
.users .sec-lead { color: rgba(255, 248, 231, .85); margin-bottom: 0; }
.users-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; }

.foot { background: var(--navy); color: rgba(255, 248, 231, .8); font-size: 14.5px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 22px; flex-wrap: wrap; }

/* ---- ielogošanās logs ---- */
.login {
  width: min(460px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 26px 26px 22px;
  background: var(--cream); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login::backdrop { background: rgba(31, 42, 68, .6); backdrop-filter: blur(2px); }
.login .x {
  position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: transparent; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer;
}
.login .x:hover { background: var(--cream-dark); }
.login-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-right: 30px; }
.login-head img { width: 58px; height: 58px; }
.login-head h2 { font-size: 26px; margin: 0; }
.login-head p { margin: 0; font-size: 14.5px; }
.step label { display: block; font-weight: 600; margin-bottom: 6px; }
.step input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--white);
  font: 17px var(--sans); color: var(--text);
}
.step input:focus { outline: none; border-color: var(--gold); }
.step input.code { font: 700 28px/1 var(--sans); letter-spacing: .4em; text-align: center; padding: 14px; }
.hint { font-size: 14.5px; color: var(--muted); margin: 8px 0 14px; }
.err { color: var(--red); font-weight: 600; font-size: 15px; margin: 0 0 10px; min-height: 0; }
.err:empty { display: none; }
.links { display: flex; justify-content: space-between; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.center { text-align: center; padding: 18px 0; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%;
  border: 4px solid var(--cream-dark); border-top-color: var(--red); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hello { font-size: 19px; margin: 0 0 4px; }
.roles { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.roles span { background: var(--gold-tint); color: #5E4700; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.choices { display: grid; gap: 10px; margin-bottom: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: var(--white); border: 2px solid var(--line); color: var(--text); transition: border-color .15s, transform .12s;
}
.choice:hover { border-color: var(--red); }
.choice:active { transform: translateY(1px); }
.choice img { width: 48px; height: 48px; border-radius: 12px; flex: none; object-fit: contain; }
.choice span { display: flex; flex-direction: column; flex: 1; }
.choice b { font-size: 17px; }
.choice small { color: var(--muted); font-size: 14px; }
.choice i { font-style: normal; font-size: 22px; color: var(--red); font-weight: 700; }
.choice.off { opacity: .55; pointer-events: none; }

/* ---- mazāki ekrāni ---- */
@media (max-width: 960px) {
  .modules { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .users-btn { margin-left: auto; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 28px; }
  .hero-in { grid-template-columns: 1fr; gap: 10px; }
  .hero-art { order: -1; }
  .hero-art img { width: 210px; }
  .hero-text { text-align: center; }
  .hero-actions { justify-content: center; }
  .lead { font-size: 17px; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 28px; }
  .parts, .modules, .two { grid-template-columns: 1fr; }
  .sec { padding: 46px 0; }
  .flow { flex-direction: column; }
  .arrow { transform: rotate(90deg); }
  .users-in { flex-direction: column; align-items: flex-start; }
  .kab-head img { width: 60px; height: 60px; border-radius: 14px; }
  .brand span { font-size: 20px; }
  .wrap { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 2s; }
}
