/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
}

body {
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  /* Точний колір фону з оригіналу — тепло-бежевий/оливковий */
  background-color: #dddacf;
  color: #1c1c1e;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   SAFE AREAS
   ============================================================ */
.safe-top {
  height: env(safe-area-inset-top, 44px);
  background-color: #dddacf;
  flex-shrink: 0;
}

.safe-bottom {
  height: env(safe-area-inset-bottom, 0px);
  background-color: #ffffff;
  flex-shrink: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background-color: #dddacf;
  padding: 4px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-bottom: 3rem;
  margin-top: 1rem;
}

.notification-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  /* Біла напівпрозора капсула */
  background: rgba(255, 255, 255, 0.72);
  border: none;
  border-radius: 22px;
  padding: 7px 12px 7px 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.notif-text {
  font-size: 15px;
  font-weight: 400;
  color: #1c1c1e;
  letter-spacing: -0.15px;
}

.bell-icon {
  width: 19px;
  height: 21px;
  color: #1c1c1e;
  flex-shrink: 0;
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  flex: 1;
  padding: 2px 14px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main::-webkit-scrollbar { display: none; }

/* ============================================================
   CARD FLIP
   ============================================================ */
.card-scene {
  perspective: 1200px;
  width: 100%;
  border-radius: 18px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card-scene.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  width: 100%;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* ============================================================
   CARD FRONT
   ============================================================ */
.card-front {
  background-color: #cdc8b4;
  box-shadow:
    0 2px 12px rgba(0,0,0,0.10),
    0 8px 28px rgba(0,0,0,0.12);
  position: relative;
}

/* --- Top area --- */
.card-top {
  padding: 18px 18px 0 18px;
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* Тризуб в щиті */
.trident-icon {
  width: 34px;
  height: 40px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Info + photo row */
.card-info-photo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}

.card-info-col {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-label {
  font-size: 12px;
  color: #6b6b5e;
  font-weight: 400;
  letter-spacing: 0.05px;
  line-height: 1.3;
  margin-bottom: 1px;
}

.card-label--mt {
  margin-top: 10px;
}

.card-dob {
  font-size: 17px;
  font-weight: 500;
  color: #1c1c1e;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

/* Photo */
.card-photo-wrap {
  width: 110px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background-color: #b8b3a0;
  /* Висота підбирається автоматично */
  align-self: stretch;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker-wrap {
  /* Коричнево-золота смуга точно як в додатку */
  background-color: #7a5c2a;
  padding: 2px 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-block;
  animation: ticker 20s linear infinite;
  will-change: transform;
}

.ticker-item {
  font-size: 12px;
  font-weight: 400;
  color: #e8d5a8;
  letter-spacing: 0.3px;
}

.ticker-dot {
  font-size: 12px;
  color: #c8a84a;
  font-weight: 700;
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   CARD BOTTOM
   ============================================================ */
.card-bottom {
  padding: 12px 18px 18px;
}

.card-bottom-label {
  font-size: 12px;
  color: #6b6b5e;
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: 0.05px;
}

.card-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.card-name {
  font-size: 23px;
  font-weight: 700;
  color: #1c1c1e;
  line-height: 1.18;
  letter-spacing: -0.3px;
}

/* Orange + button */
.add-btn {
  width: 44px;
  height: 44px;
  background-color: #f07020;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.add-btn:active {
  transform: scale(0.91);
  box-shadow: 0 1px 5px rgba(240,112,32,0.3);
}

.add-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   CARD BACK
   ============================================================ */
.card-back {
  position: absolute;
  inset: 0;
  background-color: #f5f5f0;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 12px rgba(0,0,0,0.10),
    0 8px 28px rgba(0,0,0,0.12);
}

.card-back-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px 36px;
  gap: 20px;
  width: 100%;
}

.qr-validity {
  font-size: 14px;
  color: #3c3c3c;
  font-weight: 400;
  text-align: center;
  letter-spacing: -0.1px;
}

.qr-img {
  width: 72%;
  max-width: 240px;
  aspect-ratio: 1;
  display: block;
  border-radius: 6px;
  image-rendering: pixelated;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  background-color: #ffffff;
  border-top: 0.5px solid rgba(0,0,0,0.14);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 4px 7px;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  color: #acacb3;
  min-height: 52px;
}

.nav-item--active {
  color: #1c1c1e;
}

/* Підкреслення активного пункту — тонка смуга знизу */
.nav-item--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2.5px;
  background-color: #1c1c1e;
  border-radius: 2px 2px 0 0;
}

.nav-icon {
  width: 24px;
  height: 24px;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.1px;
  line-height: 1;
  white-space: nowrap;
}
