/* Preluare documente clienți — aplicația clientului */

:root {
  --paper: #f7f6f1;
  --surface: #ffffff;
  --ink: #1c201d;
  --muted: #5e645f;
  --rule: #dad8ce;
  --accent: #1e5c3f;
  --accent-dark: #123b28;
  --accent-soft: #e7efe9;
  --danger: #8e3b2f;
  --ok: #1e5c3f;
  --warn: #8a5a16;
  --radius: 14px;
  --tap: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13160f;
    --surface: #1b1e17;
    --ink: #e9eae1;
    --muted: #9aa095;
    --rule: #2e342a;
    --accent: #7fc29a;
    --accent-dark: #a9dbbe;
    --accent-soft: #1f2c24;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

[hidden] { display: none !important; }

h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- header ---- */
.app-head {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.2rem;
}
.app-head .pentru {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.app-head .firma { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }

/* ---- segmented (PFA / PF) ---- */
.segmented {
  display: flex;
  gap: .3rem;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: .3rem;
}
.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 600;
  padding: .6rem;
  border-radius: 8px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ---- month picker ---- */
.luna-pick {
  display: flex;
  align-items: stretch;
  gap: .5rem;
  margin: .4rem 0 1rem;
}
.luna-pick select {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: .7rem;
  min-height: var(--tap);
  appearance: none;
}
.luna-pick button {
  width: var(--tap);
  min-height: var(--tap);
  font-size: 1.4rem;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

/* ---- big action buttons ---- */
.actiuni { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.btn-mare {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 108px;
  padding: 1rem .5rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-mare svg { width: 30px; height: 30px; }
.btn-mare input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---- thumbnails ---- */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--rule); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.62); color: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.adauga-mai {
  background: none; border: 1.5px dashed var(--rule); color: var(--muted);
  border-radius: 10px; padding: .7rem; width: 100%; font-size: .95rem; cursor: pointer;
}

/* ---- etichete ---- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1.5px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
input[type="text"].detaliu {
  margin-top: .6rem;
  width: 100%;
  font-size: 1rem;
  padding: .7rem;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

/* ---- submit ---- */
.trimite {
  margin-top: 1.4rem;
  width: 100%;
  min-height: 60px;
  font-size: 1.15rem;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.trimite:disabled { opacity: .45; cursor: not-allowed; }

.pin-input {
  font-size: 2rem;
  letter-spacing: .6em;
  text-align: center;
  width: 100%;
  padding: .7rem;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  margin: 1rem 0;
}

/* ---- bara de instalare ---- */
.install-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: .7rem .8rem;
  margin: .2rem 0 1rem;
  font-size: .92rem;
  line-height: 1.35;
}
.install-bar span { flex: 1; }
.install-bar #install-btn {
  flex: none;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .5rem .9rem;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}
.install-bar #install-close {
  flex: none;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 .1rem;
  cursor: pointer;
}

/* ---- banners ---- */
.banner { border-radius: 12px; padding: 1rem 1.1rem; margin: 1rem 0; }
.banner.ok { background: var(--accent-soft); border-left: 4px solid var(--ok); }
.banner.bad { background: #f6e5e1; border-left: 4px solid var(--danger); color: #5c221a; }
.banner.wait { background: #f3ead9; border-left: 4px solid var(--warn); color: #4a3818; }
@media (prefers-color-scheme: dark) {
  .banner.bad { background: #2a1713; color: #f0c5bb; }
  .banner.wait { background: #2a2418; color: #e5c890; }
}

/* ---- history ---- */
.istoric { list-style: none; padding: 0; margin: .5rem 0 0; }
.istoric li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--rule);
}
.istoric .st { font-size: .85rem; white-space: nowrap; }
.istoric .st.urcata { color: var(--ok); }
.istoric .st.esuata { color: var(--danger); }
.istoric .st.primita, .istoric .st.in_curs { color: var(--warn); }

.link-jos { display: block; text-align: center; margin-top: 2rem; color: var(--muted); font-size: .9rem; }
a { color: var(--accent); }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--rule); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin: 3rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
