/* Föreningskassan – designsystem från Claude Design-prototypen (IFK Kungälv) */

@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-Black.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-UltraBlack.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Quatro"; src: url("/fonts/Quatro-UltraBlackItalic.ttf") format("truetype"); font-weight: 900; font-style: italic; font-display: swap; }

:root {
  --bg: #F6F5F0;
  --navy-dark: #0E2148;
  --navy: #1E3C72;
  --blue-soft: #8097C2;
  --blue-tint: #DAE0ED;
  --blue-faint: #EFF2F8;
  --ink: #1A1D24;
  --gray-dark: #4F5461;
  --gray: #878D9A;
  --border: #C1C5CE;
  --line: #E5E7EC;
  --red: #AB182D;
  --red-dark: #7D0F20;
  --red-tint: #FBE9EC;
  --green: #3D8F7A;
  --white: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(14, 33, 72, 0.08);
  --shadow-pop: 0 18px 40px -12px rgba(14, 33, 72, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: "Quatro", ui-sans-serif, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
button { -webkit-tap-highlight-color: transparent; font-family: inherit; }
input, select { font-family: inherit; }

@keyframes ifk-spin { to { transform: rotate(360deg); } }

.shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* Header */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.app-header__logo { height: 44px; width: auto; }
.app-header__title {
  font-weight: 800; font-size: 18px; line-height: 1;
  color: var(--navy-dark); text-transform: uppercase; letter-spacing: -0.01em;
}
.app-header__sub {
  font-weight: 600; font-size: 12px; line-height: 1;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray);
  margin-top: 2px;
}
.app-header__action {
  margin-left: auto; min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; border: 2px solid var(--border); background: var(--white);
  border-radius: 8px; font-weight: 700; font-size: 15px; color: var(--gray-dark);
  cursor: pointer; text-decoration: none;
}
.app-header__action:hover { color: var(--gray-dark); }
.app-header__action:active { background: var(--line); }
.app-header__action--icon { padding: 0; }

/* Typografi */
.eyebrow {
  font-weight: 600; font-size: 15px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray);
}
.section-label {
  font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray);
}
.amount-hero {
  font-weight: 900; font-style: italic; line-height: 0.9;
  letter-spacing: -0.03em; color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}
.page-title { font-weight: 800; font-size: 24px; color: var(--navy-dark); margin: 0; }
.page-intro { font-weight: 500; font-size: 15px; color: var(--gray); margin: 4px 0 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* Kort och listor */
.card {
  background: var(--white); border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.card--pad { padding: 16px; }
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }

/* Knappar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 8px; cursor: pointer;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em;
  text-decoration: none; text-align: center;
}
.btn:disabled { cursor: default; }
.btn--primary { background: var(--navy); color: var(--white); font-size: 22px; min-height: 60px; }
.btn--primary:active { background: var(--navy-dark); }
.btn--cta { background: var(--red); color: var(--white); font-size: 22px; min-height: 60px; }
.btn--cta:active { background: var(--red-dark); }
.btn--cta:disabled { background: var(--border); }
.btn--success { background: var(--green); color: var(--white); font-size: 22px; min-height: 64px; }
.btn--success:active { filter: brightness(0.9); }
.btn--outline {
  background: var(--white); border: 2px solid var(--border); color: var(--gray-dark);
  font-weight: 700; font-size: 15px; text-transform: none; letter-spacing: 0; min-height: 44px;
}
.btn--outline:active { background: var(--line); }
.btn--danger-outline {
  background: var(--white); border: 2px solid var(--red); color: var(--red);
  font-weight: 700; font-size: 14px; text-transform: none; letter-spacing: 0; min-height: 44px;
}
.btn--danger-outline:active { background: var(--red-tint); }
.btn--danger { background: var(--red); color: var(--white); font-weight: 800; font-size: 17px; text-transform: none; letter-spacing: 0; min-height: 56px; }
.btn--danger:active { background: var(--red-dark); }
.btn--block { width: 100%; }
.btn--compact { min-height: 44px; padding: 0 14px; font-size: 14px; }

/* Formulär */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; color: var(--gray-dark); }
.input {
  min-height: 52px; border: 2px solid var(--border); border-radius: 8px;
  padding: 0 14px; font-weight: 600; font-size: 16px; color: var(--ink);
  background: var(--white); width: 100%;
}
.input:focus { outline: none; border-color: var(--navy); }
.input--error { border-color: var(--red); }
.form-error { font-weight: 600; font-size: 14px; color: var(--red); margin: 0; }

/* Väljarknappar (lag/kiosk/roll/valör) */
.choice {
  min-height: 56px; border: 3px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--navy-dark);
  font-weight: 700; font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.choice:hover { color: var(--navy-dark); }
.choice:active { background: var(--blue-tint); }
.choice--selected { border-color: var(--navy); background: var(--blue-tint); }
.choice--left { justify-content: flex-start; padding: 0 16px; }

/* Produktrutnät (kassan) */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card {
  background: var(--white); border-radius: 14px; border: 3px solid var(--white);
  box-shadow: var(--shadow-card); overflow: hidden;
  display: flex; flex-direction: column;
}
.product-card--active { border-color: var(--navy); }
.product-card__btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 14px 12px; background: none; border: none; cursor: pointer;
  text-align: left; min-height: 80px;
}
.product-card__btn:active { background: var(--blue-tint); }
.product-card__name { font-weight: 700; font-size: 21px; line-height: 1.1; color: var(--navy-dark); }
.product-card__price { font-weight: 600; font-size: 17px; color: var(--gray-dark); font-variant-numeric: tabular-nums; }
.qty-bar { display: flex; align-items: stretch; border-top: 1px solid var(--line); background: var(--blue-faint); }
.qty-bar__btn {
  flex: 1; min-height: 48px; border: none; background: none;
  font-weight: 800; font-size: 26px; color: var(--navy); cursor: pointer;
}
.qty-bar__btn:active { background: var(--blue-tint); }
.qty-bar__count {
  min-width: 48px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 22px; color: var(--navy-dark); font-variant-numeric: tabular-nums;
}

/* Kvittopanel */
.cart-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; background: var(--navy-dark);
  padding: 16px 16px 24px; box-shadow: 0 -8px 24px rgba(14, 33, 72, 0.25);
  display: flex; flex-direction: column; gap: 12px;
}
.cart-bar__row { display: flex; align-items: baseline; justify-content: space-between; }
.cart-bar__count { font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-soft); }
.cart-bar__total {
  font-weight: 900; font-style: italic; font-size: 40px; line-height: 0.9;
  letter-spacing: -0.03em; color: var(--white); font-variant-numeric: tabular-nums;
}

/* Betalning */
.pay-btn {
  min-height: 88px; border: none; border-radius: 14px;
  background: var(--navy); color: var(--white);
  font-weight: 800; font-size: 28px; cursor: pointer;
  box-shadow: 0 12px 32px -10px rgba(30, 60, 114, 0.45);
}
.pay-btn:active { background: var(--navy-dark); transform: scale(0.98); }
.pay-btn--outline {
  background: var(--white); border: 3px solid var(--navy); color: var(--navy); box-shadow: none;
}
.pay-btn--outline:active { background: var(--blue-tint); }

/* Statistikrutor */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { background: var(--white); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; }
.stat-box__label { font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray); }
.stat-box__value { font-weight: 900; font-style: italic; font-size: 28px; line-height: 0.9; color: var(--navy-dark); font-variant-numeric: tabular-nums; }
.stat-box__value--sub { font-weight: 800; font-style: normal; font-size: 22px; line-height: 1; color: var(--navy); }

/* Väntar på betalning */
.wait-banner {
  width: 100%; min-height: 64px; border-radius: 8px; background: var(--blue-tint);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.spinner {
  width: 22px; height: 22px; border-radius: 999px;
  border: 3px solid var(--blue-soft); border-top-color: var(--navy);
  animation: ifk-spin 0.9s linear infinite;
}

/* Modal + toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26, 29, 36, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50;
}
.modal {
  background: var(--white); border-radius: 14px; padding: 24px;
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-pop);
}
.modal__title { font-weight: 800; font-size: 22px; color: var(--navy-dark); }
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 398px; background: var(--navy-dark); color: var(--white);
  border-radius: 8px; padding: 14px 18px; font-weight: 700; font-size: 16px;
  box-shadow: 0 18px 40px -12px rgba(14, 33, 72, 0.4); z-index: 60; text-align: center;
}

/* Roll-badge */
.badge {
  font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 10px;
}
.badge--admin { color: var(--navy); background: var(--blue-tint); }
.badge--cashier { color: var(--gray-dark); background: var(--line); }
.badge--voided { color: var(--red); background: var(--red-tint); }

/* Diverse */
.icon-btn {
  min-width: 44px; min-height: 44px; border: none; background: none;
  font-weight: 800; font-size: 22px; color: var(--red); cursor: pointer; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: var(--red-tint); }
.note { font-weight: 500; font-size: 13px; color: var(--gray); }
.info-box { background: var(--blue-tint); border-radius: 8px; padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--navy-dark); line-height: 1.45; }
.info-box--muted { background: #F2F4F7; color: var(--gray-dark); }
.warn-box { background: var(--red-tint); border-radius: 8px; padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--red); line-height: 1.45; }
.stack { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.row { display: flex; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.center { text-align: center; }
