/* =========================================================
   DÉCAF. CASHBACK — the loyalty app at /loyalty
   Same black-and-white print language as the menu: a black
   cover card, white paper, hairlines and line-art drawings.
   ========================================================= */

.loyalty-body {
  background: #FFFFFF;
}

.loy-main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px calc(120px + env(safe-area-inset-bottom));
  position: relative;
  flex: 1;
}

.loy-view {
  animation: loy-in 0.28s ease;
}

@keyframes loy-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- the cover (sign-in screen) ---------- */
.loy-cover {
  position: relative;
  overflow: hidden;
  background: #000000;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px 24px 30px;
  margin-bottom: 22px;
  min-height: 190px;
}

.loy-cover-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 10px;
}

.loy-cover-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.05;
  position: relative;
  z-index: 1;
}

.loy-cover-title em {
  font-family: var(--font-script);
  font-style: normal;
  font-weight: 400;
  font-size: 30px;
  margin-left: 2px;
}

.loy-cover-text {
  margin-top: 14px;
  max-width: 62%;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* A steaming cup, in the white line of the menu's illustrations. */
.loy-cover-art {
  position: absolute;
  right: 10px;
  bottom: 6px;
  width: 128px;
  height: 128px;
  opacity: 0.9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 29h32v9a14 14 0 0 1-14 14h-4a14 14 0 0 1-14-14z'/%3E%3Cpath d='M45 32h3a6 6 0 0 1 0 12h-4'/%3E%3Cpath d='M9 57h42'/%3E%3Cpath d='M22 22c-3-4 3-6 0-11'/%3E%3Cpath d='M30 22c-3-4 3-6 0-11'/%3E%3Cpath d='M38 22c-3-4 3-6 0-11'/%3E%3Cpath d='M24 38l4 4 8-8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- tabs ---------- */
.loy-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.loy-tab {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 11px 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.loy-tab.active {
  background: #000000;
  color: #FFFFFF;
}

/* ---------- forms ---------- */
.loy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loy-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.loy-field input {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  color: #000000;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.loy-field input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.loy-field small {
  font-weight: 400;
  color: var(--ink-muted);
}

.loy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-secondary);
  background: #F4F4F4;
  border-radius: 14px;
  padding: 12px 14px;
}

.loy-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.loy-error {
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  background: #FFFFFF;
  border: 1px solid #000000;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 10px 12px;
}

.loy-btn {
  appearance: none;
  border: 0;
  background: #000000;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.loy-btn:active {
  transform: scale(0.98);
}

.loy-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.loy-btn-ghost {
  background: transparent;
  color: #000000;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.loy-link {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px;
  cursor: pointer;
  align-self: center;
}

.loy-link:disabled {
  color: var(--ink-muted);
  text-decoration: none;
  cursor: default;
}

.loy-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  padding: 6px 0;
  cursor: pointer;
  margin-bottom: 18px;
}

.loy-h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 8px;
}

.loy-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.loy-code-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #000000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.loy-code-input {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 14px 10px 14px calc(10px + 0.4em);
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  outline: none;
  width: 100%;
}

.loy-code-input:focus {
  border-color: #000000;
}

/* ---------- the cashback card ---------- */
.loy-card {
  position: relative;
  overflow: hidden;
  background: #000000;
  color: #FFFFFF;
  border-radius: 22px;
  padding: 22px 22px 20px;
  aspect-ratio: 1.586;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.loy-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loy-card-logo {
  height: 34px;
  width: auto;
  filter: invert(1);
  margin-left: -6px;
}

.loy-card-rate {
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-full);
  padding: 4px 10px;
}

.loy-card-label {
  margin-top: auto;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}

.loy-card-balance {
  font-family: var(--font-display);
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 500;
  line-height: 1.1;
  margin-top: 4px;
}

.loy-card-balance small {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 6px;
}

.loy-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
}

.loy-card-name {
  font-size: 15px;
  font-weight: 600;
}

.loy-card-phone {
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-top: 2px;
}

/* coffee beans, like the corner of the printed menu */
.loy-card-art {
  width: 64px;
  height: 64px;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23FFFFFF' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='24' cy='38' rx='10' ry='15' transform='rotate(-30 24 38)'/%3E%3Cpath d='M17 27c6 5 2 13 7 17 3 3 6 3 7 6'/%3E%3Cellipse cx='46' cy='20' rx='8' ry='12' transform='rotate(30 46 20)'/%3E%3Cpath d='M42 11c-2 6 6 9 4 15'/%3E%3C/svg%3E") center / contain no-repeat;
}

.loy-hint {
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 14px 8px 18px;
  line-height: 1.45;
}

.loy-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 26px;
}

.loy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px;
}

.loy-stat + .loy-stat {
  border-left: 1px solid var(--line);
}

.loy-stat-value {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.loy-stat-label {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.loy-h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 10px;
}

/* ---------- history ---------- */
.loy-history {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.loy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.loy-row-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loy-row-main {
  flex: 1;
  min-width: 0;
}

.loy-row-title {
  font-size: 15px;
  font-weight: 600;
}

.loy-row-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.loy-row-amount {
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.loy-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.loy-badge-approved {
  background: #000000;
  color: #FFFFFF;
}

.loy-badge-review {
  border: 1px dashed #000000;
  color: #000000;
}

.loy-badge-rejected {
  background: #EDEDED;
  color: #6A6A6A;
  text-decoration: line-through;
}

.loy-row.is-rejected .loy-row-amount {
  color: var(--ink-light);
  text-decoration: line-through;
}

.loy-empty {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
  padding: 26px 18px;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 18px;
}

.loy-logout {
  display: block;
  margin: 26px auto 0;
  color: var(--ink-muted);
}

/* ---------- the button at the bottom ---------- */
.loy-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #FFFFFF 62%, rgba(255, 255, 255, 0));
  display: flex;
  justify-content: center;
}

.loy-scan-btn {
  width: 100%;
  max-width: 448px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #000000;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  padding: 18px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease;
  user-select: none;
}

.loy-scan-btn:active {
  transform: scale(0.98);
}

/* ---------- reading sheet ---------- */
.loy-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.loy-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow: auto;
  background: #FFFFFF;
  border-radius: 26px 26px 0 0;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  animation: loy-sheet 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: center;
}

@keyframes loy-sheet {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.loy-scan-preview {
  position: relative;
  width: 150px;
  height: 200px;
  margin: 6px auto 18px;
  border-radius: 14px;
  overflow: hidden;
  background: #F2F2F2;
  border: 1px solid var(--line);
}

.loy-scan-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
}

.loy-scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #000000;
  box-shadow: 0 0 18px 6px rgba(255, 255, 255, 0.9);
  animation: loy-beam 1.6s ease-in-out infinite alternate;
}

.loy-scan-beam[hidden] {
  display: none;
}

@keyframes loy-beam {
  from { top: 4%; }
  to { top: 94%; }
}

.loy-state-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 6px;
}

.loy-state-text {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.loy-state-big {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  margin: 4px 0 2px;
}

.loy-state-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.loy-state-details div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

.loy-state-details b {
  display: block;
  font-size: 15px;
  color: #000000;
  margin-top: 2px;
}

.loy-sheet .loy-btn {
  width: 100%;
}

/* ---------- first load ---------- */
.loy-loading {
  display: flex;
  justify-content: center;
  padding: 80px 0;
}

.loy-loading[hidden] {
  display: none;
}

.loy-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: #000000;
  border-radius: 50%;
  animation: loy-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .loy-view,
  .loy-sheet,
  .loy-scan-beam {
    animation: none;
  }
}

/* ---------- confirming the number in Telegram ---------- */
.loy-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 22px;
}

.loy-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.4;
}

.loy-steps li::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.loy-btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.loy-btn-link[hidden] {
  display: none;
}

.loy-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 12px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.loy-wait[hidden] {
  display: none;
}

.loy-spinner-sm {
  width: 18px;
  height: 18px;
}

html.in-telegram .loy-dock {
  padding-bottom: calc(14px + var(--tg-bottom, 0px));
}

/* ---------- the game, from the account ---------- */
.loy-game {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: -8px 0 26px;
  border: 1px solid #000000;
  border-radius: 18px;
  color: #000000;
  text-decoration: none;
}

.loy-game-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #000000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
}

.loy-game-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loy-game-text b {
  font-size: 15px;
}

.loy-game-text small {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Phones: the "show receipt" button sits just above the bottom tab bar and
   follows it down when the bar steps aside. */
@media (max-width: 760px) {
  html.has-tabbar .loy-dock {
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
    padding-bottom: 10px;
    transition: bottom 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  html.has-tabbar.chrome-hidden .loy-dock {
    bottom: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  html.has-tabbar .loy-main {
    padding-bottom: calc(110px + var(--tabbar-h));
  }
}
