/* ============================================================
   Wallets — money kept in different places / currencies.
   Reuses the journal shell classes (.journal, .journal-head,
   .journal-add, .journal-empty) from books.css; adds its own
   aged-paper page background and wallet-specific pieces.
   ============================================================ */

/* Page background (sepia architectural illustration) is shared with the books
   journal — see books.css `body.c-wallets` in the background rule. */

/* ---------- Totals per currency ---------- */
.wallet-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 6px auto 30px;
}
.wallet-total {
  position: relative;
  min-width: 190px;
  padding: 14px 28px;
  text-align: center;
  background: #fbf7ec;
  border: 1px solid #e2d4b6;
  border-radius: 10px;
  box-shadow: 0 10px 24px -16px rgba(60, 45, 25, 0.55);
}
.wallet-total__label {
  display: block;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: #8a7d63;
}
.wallet-total__value {
  display: block;
  margin-top: 2px;
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.05;
  color: #23201a;
}
.wallet-total--uah { border-bottom: 3px solid #4a7fb5; }
.wallet-total--usd { border-bottom: 3px solid #5f8a5f; }

.wallet-rate {
  margin: -14px 0 30px;
  padding: 8px 0;
  text-align: center;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  color: #4a4235;
  text-shadow: 0 0 8px rgba(240, 231, 209, 0.95), 0 1px 2px rgba(240, 231, 209, 0.9);
  /* soft light backing that fades out — same idea as the header subtitle */
  background: radial-gradient(ellipse 55% 150% at 50% 50%, rgba(240, 231, 209, 0.82), rgba(240, 231, 209, 0) 72%);
}

/* ---------- Toolbar ---------- */
.wallet-toolbar {
  display: flex;
  justify-content: center;
  margin: 0 0 34px;
}

/* ---------- Wallet cards ---------- */
.wallets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.wallet-card {
  position: relative;
  padding: 18px 20px 18px 24px;
  background: #fbf7ec;
  border: 1px solid #e2d4b6;
  border-radius: 10px;
  box-shadow: 0 10px 24px -16px rgba(60, 45, 25, 0.55);
}
.wallet-card::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
}
.wallet-card--uah::before { background: #4a7fb5; }
.wallet-card--usd::before { background: #5f8a5f; }

.wallet-card__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.wallet-card__name {
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  color: #23201a;
  word-break: break-word;
}
.wallet-card__cur {
  flex: none;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  color: #6f6256;
  border: 1.5px solid #cdbf9e;
  border-radius: 20px;
  padding: 1px 9px;
}
.wallet-card__amount {
  margin-top: 10px;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  color: #23201a;
}
/* debts (negative amounts) stand out in red */
.wallet-card__amount.is-debt,
.wallet-total__value.is-debt { color: #9c3b2e; }
.wallet-card__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.wallet-card__actions form { margin: 0; display: inline-flex; }
.wallet-link {
  display: inline-flex;
  align-items: center;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1;
  color: #6f6256;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.wallet-link:hover { color: #23201a; }
.wallet-link--danger { color: #9c3b2e; }
.wallet-link--danger:hover { color: #7d2f24; }

/* ---------- Form (paper page taped down) ---------- */
.wallet-form {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 32px 26px;
  background: #f6efdd;
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 14px 32px -16px rgba(60, 45, 25, 0.55);
}
.wallet-form::before {
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 128px; height: 26px;
  background: rgba(228, 213, 166, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wf-field { margin-bottom: 20px; }
.wf-field > label,
.wf-label {
  display: block;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  color: #7d2f24;
  margin-bottom: 6px;
}
.wf-field input[type="text"],
.wf-field input[type="number"] {
  width: 100%;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  color: #23201a;
  background: #fbf7ec;
  border: 1px solid #cdbf9e;
  border-radius: 9px;
  padding: 11px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.wf-field input:focus {
  outline: none;
  border-color: #9c3b2e;
  box-shadow: 0 0 0 3px rgba(156, 59, 46, 0.15);
}

/* currency picker — radios styled as chips (no JS; uses :has) */
.wf-currencies { display: flex; gap: 10px; }
.wf-cur { position: relative; flex: 1; cursor: pointer; }
.wf-cur input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.wf-cur span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1rem;
  color: #4a4235;
  background: #fbf7ec;
  border: 1.5px solid #cdbf9e;
  border-radius: 9px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.wf-cur:hover span { border-color: #9c3b2e; }
.wf-cur:has(input:checked) span {
  background: #9c3b2e;
  border-color: #9c3b2e;
  color: #fff7ef;
}
.wf-cur:has(input:focus-visible) span { box-shadow: 0 0 0 3px rgba(156, 59, 46, 0.2); }

.wf-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}
.wf-submit {
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #efe4c8;
  background: #23201a;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(35, 32, 26, 0.2);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.wf-submit:hover {
  background: #171410;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(35, 32, 26, 0.24);
}
.wf-cancel {
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.25rem;
  color: #6f6256;
}
.wf-cancel:hover { color: #23201a; }

@media (max-width: 560px) {
  .wallet-form { padding: 26px 22px 24px; }
}
