/* PHNX PT — Apple Store-inspired minimal design */

:root {
  --bg: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-tertiary: #AEAEB2;
  --divider: #E5E5EA;
  --black: #1D1D1F;
  --accent: #FF6B35;
  --accent-dark: #E55A2B;
  --success: #34C759;
  --danger: #FF3B30;
  --warning: #FF9500;
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 80px; /* space for tab bar */
}

body > *:not(#app):not(script):not(style):not(link) {
  display: none !important;
}

/* ========== SCREENS ========== */
.screen {
  display: none;
  padding: 0 20px 20px;
  animation: fadeIn 0.25s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hidden {
  display: none !important;
}

/* ========== LOADING ========== */
#loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

#loading.active {
  display: flex;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--divider);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.loading-slots {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid var(--divider);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== HEADER ========== */
.header {
  padding: 20px 0 8px;
}

.header-logo {
  height: 28px;
  width: auto;
  margin-bottom: 16px;
  opacity: 0.9;
}

.header h1 {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 400;
  margin-top: 4px;
}

.header.compact {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.header.compact h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

/* ========== TAB CONTENT AREAS ========== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========== BOTTOM TAB BAR ========== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--divider);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.tab-item svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-tertiary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}

.tab-item span {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.15s;
}

.tab-item.active svg {
  stroke: var(--accent);
}

.tab-item.active span {
  color: var(--accent);
  font-weight: 600;
}

/* ========== SECTIONS ========== */
.section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* ========== HERO BOOKING CTA ========== */
.hero-cta {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 32px;
  text-align: center;
}

.hero-cta h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.hero-cta p {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
}

.hero-cta .btn-hero {
  display: inline-block;
  background: #fff;
  color: var(--black);
  font-size: 17px;
  font-weight: 600;
  padding: 14px 40px;
  border: none;
  border-radius: 980px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.hero-cta .btn-hero:active {
  opacity: 0.7;
}

.secondary-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.secondary-actions button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}

.secondary-actions button:active {
  color: rgba(255,255,255,0.8);
}

/* ========== SESSIONS COUNT ========== */
.sessions-overview {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0 4px;
}

.sessions-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -2px;
  line-height: 1;
}

.sessions-label {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ========== PACKAGE ITEMS (Home tab) ========== */
.package-list {
  margin-bottom: 24px;
}

.package-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--divider);
}

.package-row:last-child {
  border-bottom: none;
}

.package-row .pkg-name {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
}

.package-row .pkg-name small {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  margin-left: 6px;
}

.package-row .pkg-count {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.package-row .pkg-count.low {
  color: var(--danger);
}

/* ========== MAKEUP SECTION ========== */
.makeup-banner {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.makeup-info {
  flex: 1;
}

.makeup-info .makeup-count {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.makeup-info .makeup-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-makeup {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 980px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

/* ========== SESSION CARDS ========== */
.session-list {
  display: flex;
  flex-direction: column;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--divider);
}

.session-item:last-child {
  border-bottom: none;
}

.session-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.session-date-block .sday {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.session-date-block .snum {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1px;
}

.session-date-block .smonth {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-info {
  flex: 1;
}

.session-info .stime {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.session-info .slabel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.session-type-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 980px;
  letter-spacing: 0.2px;
}

.session-type-tag.paid {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.session-type-tag.trial {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.session-type-tag.makeup {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.session-cancel-btn {
  background: none;
  border: 1px solid var(--divider);
  color: var(--text-tertiary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.session-cancel-btn:active {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.no-content {
  text-align: center;
  color: var(--text-tertiary);
  padding: 32px 20px;
  font-size: 15px;
}

/* ========== PROGRESS TAB ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.stat-item {
  background: var(--bg);
  padding: 24px 12px;
  text-align: center;
}

.stat-number {
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1.5px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* Badges */
.badges-section {
  margin-top: 32px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.badge-item {
  text-align: center;
}

.badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 6px;
}

.badge-item.earned .badge-icon {
  background: var(--bg-secondary);
}

.badge-item.locked .badge-icon {
  background: var(--bg-secondary);
  opacity: 0.3;
  filter: grayscale(100%);
}

.badge-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.badge-item.earned .badge-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========== ACCOUNT TAB ========== */
.account-section {
  padding: 16px 0;
  border-bottom: 0.5px solid var(--divider);
}

.account-section:last-child {
  border-bottom: none;
}

.account-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.device-row .device-label {
  display: flex;
  flex-direction: column;
}

.device-row .device-label strong {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.device-row .device-label small {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-outline {
  background: none;
  border: 1px solid var(--divider);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 980px;
  cursor: pointer;
  font-family: inherit;
}

.btn-outline:active {
  background: var(--bg-secondary);
}

.btn-outline.danger {
  color: var(--danger);
  border-color: var(--danger);
}

/* Buy Package link */
.buy-link {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 12px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
}

.buy-link:active {
  color: var(--text-primary);
}

/* ========== BUTTONS ========== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.7;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:active {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 10px 20px;
  font-size: 15px;
}

.btn-back {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.btn-back:active {
  background: var(--divider);
}

/* ========== BOOKING SCREEN ========== */
.date-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.date-selector::-webkit-scrollbar {
  display: none;
}

.date-option {
  flex-shrink: 0;
  width: 64px;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.date-option:active {
  background: var(--divider);
}

.date-option.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

.date-option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-option .day {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.date-option .date-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.date-option .slots {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.6;
}

/* Time Grid */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.time-option {
  padding: 14px;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-primary);
}

.time-option:active {
  background: var(--divider);
}

.time-option.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

.time-option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Confirmation */
.confirmation-box {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.confirm-date {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.confirm-time {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.confirm-type {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Booking section titles */
.booking-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.booking-card {
  margin-bottom: 24px;
}

/* ========== PACKAGES SCREEN ========== */
.packages-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.package-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid transparent;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
}

.package-card:active {
  background: var(--divider);
}

.package-card.popular {
  border-color: var(--accent);
  background: var(--bg);
}

.popular-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.5px;
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.package-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.per-session {
  font-size: 15px;
  color: var(--text-secondary);
}

.savings {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
  margin-top: 2px;
}

/* ========== PAYMENT SCREEN ========== */
.payment-summary {
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.payment-summary h3 {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 600;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.payment-icon {
  font-size: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-details {
  flex: 1;
}

.payment-details strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.payment-details small {
  font-size: 13px;
  color: var(--text-secondary);
}

.instructions {
  padding-left: 20px;
  line-height: 2;
  color: var(--text-primary);
  font-size: 15px;
}

.instructions li {
  margin-bottom: 4px;
}

.instructions strong {
  font-weight: 600;
}

.payment-section-card {
  margin-bottom: 24px;
}

.payment-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* ========== SUCCESS SCREEN ========== */
#success {
  text-align: center;
  padding-top: 80px;
}

.success-animation {
  margin-bottom: 32px;
}

.checkmark {
  width: 72px;
  height: 72px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  margin: 0 auto;
  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

#success h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

#success p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 40px;
}

/* ========== NEW USER NOTICE ========== */
.new-user-notice {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 360px) {
  .header h1 {
    font-size: 28px;
  }

  .sessions-number {
    font-size: 40px;
  }

  .time-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
