/* The Living Bookshelf · Customer Portal & Passkeys Styling (Apple HIG) */

.customer-body {
  font-family: var(--system-font);
  background: var(--system-bg);
  color: var(--label);
  margin: 0;
  padding-top: calc(56px + env(safe-area-inset-top));
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
}

.customer-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--material-bg);
  backdrop-filter: var(--material-blur);
  -webkit-backdrop-filter: var(--material-blur);
  border-bottom: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

.customer-app {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-crest-thumb, .brandmark-crest {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(13, 40, 30, 0.20), 0 0 0 1px rgba(223, 183, 108, 0.40);
  flex-shrink: 0;
  display: block;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-green, #0d281e);
  color: var(--brand-gold, #dfb76c);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(13, 40, 30, 0.25), 0 0 0 1px rgba(223, 183, 108, 0.35);
}

.brand-title {
  font-family: var(--serif-font);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--label);
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--secondary-label);
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 0.5px solid var(--separator);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 650;
  color: var(--label);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-pill:hover {
  border-color: var(--brand-gold, #dfb76c);
}

.account-pill:active {
  transform: scale(0.97);
}

.account-pill b {
  color: var(--brand-gold-text, #7a5312);
  font-weight: 750;
}

@media (prefers-color-scheme: dark) {
  .account-pill b {
    color: var(--brand-gold, #dfb76c);
  }
}

/* Live Credit Meter */
.credit-meter-card {
  background: linear-gradient(135deg, #071912 0%, #0d281e 60%, #153c2e 100%);
  color: #fbf9f4;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(223, 183, 108, 0.35);
  box-shadow: 0 8px 24px rgba(7, 25, 18, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meter-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 215, 147, 0.85);
}

.meter-badge {
  background: rgba(223, 183, 108, 0.16);
  color: var(--brand-gold, #dfb76c);
  border: 0.5px solid rgba(223, 183, 108, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  backdrop-filter: blur(10px);
}

.meter-values {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.meter-total {
  font-size: 38px;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--brand-gold, #dfb76c);
  text-shadow: 0 2px 8px rgba(223, 183, 108, 0.25);
}

.meter-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 550;
}

.meter-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  overflow: hidden;
}

.meter-progress-fill {
  height: 100%;
  width: 0%;
  background: #34c759;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Home Action Toolbar */
.home-scan-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.action-btn-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  min-height: 52px;
}

.action-btn-large.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 3px 10px rgba(34, 76, 56, 0.25);
}

.action-btn-large.secondary {
  background: var(--card-bg);
  color: var(--label);
  border: 0.5px solid var(--separator);
  box-shadow: var(--shadow-sm);
}

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

/* Scanned Book Cards */
.customer-stack-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  padding: 0 4px;
}

.customer-stack-title h3 {
  font-size: 17px;
  font-weight: 750;
  color: var(--label);
  margin: 0;
}

.customer-book-card {
  background: var(--card-bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.15s ease;
}

.customer-book-cover {
  width: 58px;
  height: 82px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--tertiary-fill);
  border: 0.5px solid var(--separator);
  flex-shrink: 0;
}

.customer-book-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.customer-book-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-book-author {
  font-size: 13px;
  color: var(--secondary-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.customer-credit-tag {
  background: rgba(22, 101, 52, 0.12);
  color: #166534;
  font-size: 12px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .customer-credit-tag {
    background: rgba(48, 209, 88, 0.2);
    color: #30d158;
  }
}

.customer-living-tag {
  background: rgba(0, 86, 179, 0.12);
  color: #0056b3;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .customer-living-tag {
    background: rgba(10, 132, 255, 0.22);
    color: #409cff;
  }
}

.btn-remove-book {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 0;
  font-size: 16px;
  color: var(--tertiary-label);
  cursor: pointer;
  padding: 4px;
}

/* Drop-off Pass / Apple Wallet Ticket */
.pass-card {
  background: linear-gradient(135deg, #071912 0%, #0d281e 60%, #153c2e 100%);
  color: #fbf9f4;
  border-radius: 20px;
  padding: 26px 22px;
  margin: 18px 0;
  box-shadow: 0 10px 30px rgba(7, 25, 18, 0.40);
  border: 1px solid rgba(223, 183, 108, 0.40);
  position: relative;
  overflow: hidden;
}

.pass-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(223, 183, 108, 0.25) 0%, transparent 70%);
}

.pass-badge {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-gold, #dfb76c);
  display: block;
  margin-bottom: 6px;
}

.pass-code {
  font-size: 42px;
  font-weight: 850;
  letter-spacing: 0.04em;
  font-family: var(--mono-font);
  color: var(--brand-gold, #dfb76c);
  text-shadow: 0 0 14px rgba(223, 183, 108, 0.35);
  margin: 4px 0 16px;
}

.pass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border-top: 1px dashed rgba(223, 183, 108, 0.25);
  padding-top: 16px;
}

.pass-item small {
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  display: block;
  font-weight: 600;
}

.pass-item b {
  font-size: 18px;
  font-weight: 750;
  color: #ffffff;
}

.pass-instructions {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 18px;
}

/* Modals & Overlays */
.customer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .customer-modal {
    align-items: center;
  }
}

.customer-modal-sheet {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUpSheet 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@media (min-width: 640px) {
  .customer-modal-sheet {
    border-radius: 20px;
    padding: 28px 24px;
    animation: scaleInSheet 0.2s ease;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes scaleInSheet {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.passkey-hero {
  text-align: center;
  padding: 10px 0 20px;
}

.passkey-icon-circle {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #091f17 0%, #0d281e 100%);
  color: var(--brand-gold, #dfb76c);
  border: 1px solid rgba(223, 183, 108, 0.45);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(13, 40, 30, 0.25);
}

.passkey-hero h2 {
  font-family: var(--serif-font);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--label);
}

.passkey-hero p {
  font-size: 14px;
  color: var(--secondary-label);
  margin: 0;
  line-height: 1.4;
}

.passkey-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.passkey-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 750;
  background: linear-gradient(135deg, #091f17 0%, #0d281e 60%, #153c2e 100%);
  color: #fbf8f2;
  border: 1px solid rgba(223, 183, 108, 0.40);
  cursor: pointer;
  min-height: 50px;
  box-shadow: 0 4px 14px rgba(9, 31, 23, 0.28);
  transition: all 0.15s ease;
}

.passkey-btn:hover {
  border-color: rgba(223, 183, 108, 0.65);
  box-shadow: 0 4px 18px rgba(223, 183, 108, 0.25);
}
  border: 0;
  cursor: pointer;
  min-height: 50px;
  box-shadow: 0 3px 10px rgba(34, 76, 56, 0.25);
}

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

.pin-fallback-link {
  text-align: center;
  margin-top: 10px;
}

.pin-fallback-link button {
  background: transparent;
  border: 0;
  color: var(--secondary-label);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Shop Shelves & Inventory Browser */
.shop-filter-card {
  background: var(--card-bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tertiary-fill);
  border: 0.5px solid var(--separator);
  border-radius: 10px;
  padding: 8px 12px;
}

.shop-search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--label);
  outline: none;
}

.btn-clear-search {
  background: transparent;
  border: 0;
  color: var(--tertiary-label);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.shop-price-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.shop-price-chips::-webkit-scrollbar {
  display: none;
}

.shop-price-chips .chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 650;
  border: 0.5px solid var(--separator);
  background: var(--secondary-fill);
  color: var(--secondary-label);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.shop-price-chips .chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.shop-live-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--system-green);
  background: rgba(52, 199, 89, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-card {
  background: var(--card-bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  align-items: flex-start;
}

.shop-card-cover {
  width: 68px;
  height: 98px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--tertiary-fill);
  border: 0.5px solid var(--separator);
  flex-shrink: 0;
}

.shop-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-card-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--label);
  line-height: 1.25;
}

.shop-card-author {
  font-size: 13px;
  color: var(--secondary-label);
}

.shop-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0 8px;
}

.shop-price-tag {
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.shop-condition-tag {
  background: var(--tertiary-fill);
  color: var(--secondary-label);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}

.shop-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-hold-action {
  flex: 1;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: 0.5px solid var(--separator);
  background: var(--secondary-fill);
  color: var(--label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-hold-action.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-hold-action:active {
  transform: scale(0.97);
}

.hold-card {
  background: var(--card-bg);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.hold-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-cancel-hold {
  background: transparent;
  border: 0;
  color: var(--system-red);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 6px;
}

/* Apple HIG Sheet Grabber */
.sheet-grabber {
  width: 38px;
  height: 5px;
  border-radius: 9999px;
  background: var(--separator);
  margin: 0 auto 16px;
}

/* Desktop Inset Segmented Navigation */
.customer-desktop-nav {
  margin-bottom: 22px;
}

.segmented {
  display: flex;
  background: var(--tertiary-fill);
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
}

.segment {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--secondary-label);
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.segment.active {
  background: var(--card-bg);
  color: var(--label);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Fixed Bottom Tab Bar */
.customer-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 49px;
  height: calc(49px + env(safe-area-inset-bottom));
  padding: 4px 6px env(safe-area-inset-bottom);
  background: var(--material-bg);
  backdrop-filter: var(--material-blur);
  -webkit-backdrop-filter: var(--material-blur);
  border-top: 0.5px solid var(--separator);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
}

.customer-tabs .mobile-tab {
  background: transparent;
  color: var(--secondary-label);
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
  padding: 2px 0;
  cursor: pointer;
}

.customer-tabs .mobile-tab .glyph {
  width: 22px;
  height: 22px;
}

.customer-tabs .mobile-tab .tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.customer-tabs .mobile-tab.active {
  color: var(--accent);
}

@media (min-width: 701px) {
  .customer-tabs {
    display: none;
  }
  .customer-desktop-nav {
    display: block;
  }
}

@media (max-width: 700px) {
  .customer-desktop-nav {
    display: none;
  }
}

/* 1-Tap Live Register Pass Styles */
.btn-amount-chip {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9999px;
  border: 1px solid var(--separator);
  background: var(--card-bg);
  color: var(--label);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-amount-chip:hover {
  border-color: var(--accent);
}

.btn-amount-chip.active {
  background: var(--accent);
  color: #0c1813;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(223, 183, 108, 0.35);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  display: inline-block;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
  70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
  100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}



