/* Stampy — componente comune (butoane, câmpuri, panouri, tabele, modale, cardul de fidelitate). */

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.045em; color: inherit; text-decoration: none; }
.logo-mark { flex: none; margin: -3px -2px -3px -4px; }

/* ---------- butoane ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14.5px; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: var(--shadow-md); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-ink); border-color: var(--brand-ink); box-shadow: 0 8px 22px rgba(255, 90, 54, .35); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }

/* ---------- câmpuri ---------- */
.field { display: block; margin-bottom: var(--s4); }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px; /* 16px: iOS nu face zoom la focus */
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); appearance: none;
}
@media (min-width: 720px) { .input, .select, .textarea { font-size: 14.5px; } }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E717C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 21, 26, .08); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[type=color] { padding: 4px; height: 44px; cursor: pointer; }
.field-row { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row.three { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background var(--t-fast); flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-fast); }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- panouri ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: var(--s5); }
@media (min-width: 720px) { .panel-pad { padding: var(--s6); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16px; font-family: var(--font-ui); letter-spacing: -.01em; font-weight: 650; }

/* ---------- etichete ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--success-soft); color: var(--success-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-ink { background: var(--ink); color: #fff; }

/* ---------- tabele (pe telefon devin liste de carduri prin .table-cards) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover { background: var(--bg); }
@media (max-width: 719px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px var(--s4); border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 2px 0; border: 0; }
  .table-cards td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12.5px; }
}

/* ---------- diverse ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.empty { text-align: center; padding: var(--s12) var(--s5); color: var(--muted); }
.empty .ic { color: var(--faint); margin-bottom: var(--s3); }
.empty h3 { color: var(--ink); font-family: var(--font-ui); font-size: 16px; letter-spacing: -.01em; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; background: var(--info-soft); color: #1D4FBF; }
.alert-warn { background: var(--warn-soft); color: #8A5300; }
.alert-danger { background: var(--danger-soft); color: #A81A33; }
.alert-ok { background: var(--success-soft); color: var(--success-ink); }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg-2); border-radius: 6px; padding: 2px 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width var(--t-slow); }

/* ---------- statistici ---------- */
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: var(--s4); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin-top: 4px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; background: rgba(20, 21, 26, .5); backdrop-filter: blur(3px); padding: 0; }
.modal-back.open { display: flex; animation: fade-in .18s var(--ease); }
.modal { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0; padding: var(--s5); padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet-up .28s var(--ease); }
.modal h2, .modal h3 { font-size: 19px; }
.modal-actions { display: flex; gap: var(--s3); margin-top: var(--s5); }
.modal-actions .btn { flex: 1; }
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: var(--s5); }
  .modal { border-radius: 20px; padding: var(--s6); animation: pop-in .22s var(--ease); }
  .modal-actions { justify-content: flex-end; }
  .modal-actions .btn { flex: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); transition: transform var(--t-slow), opacity var(--t-slow); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--danger); }

/* ---------- pagini înguste (login, înscriere) ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--s6) var(--s4); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .logo { margin-bottom: var(--s6); }
.auth-box h1 { font-size: 28px; }
.auth-foot { margin-top: var(--s5); font-size: 14px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--ink); font-weight: 600; }

/* ---------- cardul de fidelitate (SVG din src/cardsvg.js) ---------- */
.lcard { display: block; width: 100%; height: auto; border-radius: 5.5% / 8.73%; box-shadow: 0 2px 4px rgba(20, 21, 26, .12), 0 18px 44px rgba(20, 21, 26, .22); font-family: var(--font-ui); }
.lcard .lc-biz, .lcard .lc-count { font-family: var(--font-display); letter-spacing: -.02em; }
.lcard .stp-ink { transform-box: fill-box; transform-origin: center; transition: opacity .2s; }
.lcard .stp-gift { transition: opacity .2s; }
.lcard .stp.on .stp-gift { opacity: 0; }
/* ștampila nou aplicată: cade de sus, apasă, lasă un inel de tuș (clasa .just e pusă de /js/card.js) */
.lcard .stp.just .stp-ink { animation: stamp-hit .55s var(--ease-spring) both; }
.lcard .stp.just .stp-slot { animation: stamp-ring .6s var(--ease) both; }
@keyframes stamp-hit {
  0% { opacity: 0; scale: 2.4; }
  55% { opacity: 1; scale: .88; }
  100% { opacity: 1; scale: 1; }
}
@keyframes stamp-ring {
  0% { stroke-width: 1.5; }
  50% { stroke-width: 9; stroke-opacity: .5; }
  100% { stroke-width: 1.5; }
}
.lcard-shake { animation: card-shake .4s var(--ease); }
@keyframes card-shake { 30% { transform: translateY(3px) scale(.985); } 60% { transform: translateY(-1px); } }
