/* ============================================
   MY LEYENDS — Design System & Base Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=Playfair+Display:wght@600;700&display=swap');

/* ── Variables ─────────────────────────────── */
:root {
  --brand-blue:    #1A6EB5;
  --brand-teal:    #18B88A;
  --brand-deep:    #0D3F6B;
  --brand-light:   #E8F4FF;

  --accent-coral:  #F05A4F;
  --accent-gold:   #F5A623;
  --accent-purple: #7B5EA7;
  --accent-green:  #27AE60;

  --bg-page:       #F0F4F8;
  --bg-card:       #FFFFFF;
  --bg-input:      #F7F9FC;
  --bg-glass:      rgba(255,255,255,0.85);

  --text-primary:  #0D1B2A;
  --text-secondary:#4A5568;
  --text-muted:    #8A97A8;
  --text-white:    #FFFFFF;

  --border-light:  rgba(0,0,0,0.06);
  --border-mid:    rgba(0,0,0,0.12);
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.14);
  --shadow-blue:   0 6px 24px rgba(26,110,181,0.30);
  --shadow-teal:   0 6px 20px rgba(24,184,138,0.28);

  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --radius-pill:   999px;

  --font-display:  'Playfair Display', serif;
  --font-body:     'DM Sans', sans-serif;

  --nav-height:    72px;
  --topbar-height: 60px;
  --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
img { display: block; max-width: 100%; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}
button { cursor: pointer; background: none; }
a { color: inherit; text-decoration: none; }

/* ── Phone Frame ────────────────────────────── */
.phone-frame {
  width: 375px;
  min-height: 780px;
  background: var(--bg-card);
  border-radius: 44px;
  box-shadow:
    0 0 0 10px #1A1A2E,
    0 0 0 12px #2D2D44,
    var(--shadow-lg),
    0 40px 80px rgba(0,0,0,0.25);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Status Bar */
.status-bar {
  height: 44px;
  background: var(--brand-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 20;
}
.status-bar .time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: 0.3px;
}
.status-bar .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.status-bar .icons span {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
}

/* ── Screens ────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen-body::-webkit-scrollbar { display: none; }

/* ── Top Bar ─────────────────────────────────── */
.top-bar {
  height: var(--topbar-height);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  z-index: 10;
}
.top-bar h2 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  letter-spacing: -0.2px;
}
.top-bar .back-btn,
.top-bar .action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.top-bar .back-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
}
.top-bar .back-btn:hover { background: #E2E8F0; }
.top-bar .action-btn {
  background: var(--brand-blue);
  color: #fff;
}
.top-bar .action-btn:hover { background: var(--brand-deep); }
.top-bar .action-btn svg,
.top-bar .back-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── Bottom Nav ─────────────────────────────── */
.bottom-nav {
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; transition: stroke var(--transition); }
.nav-item span { font-size: 10px; font-weight: 500; color: var(--text-muted); transition: color var(--transition); }
.nav-item.active svg { stroke: var(--brand-blue); }
.nav-item.active span { color: var(--brand-blue); }
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  background: var(--brand-blue);
  border-radius: var(--radius-pill);
}

/* FAB */
.fab {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}
.fab:hover { transform: translateX(-50%) scale(1.06); }
.fab:active { transform: translateX(-50%) scale(0.96); }
.fab svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; }
.fab-spacer { width: 56px; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transition: all var(--transition);
  text-align: center;
  display: block;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), #2481CC);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: linear-gradient(135deg, var(--brand-teal), #20D4A0);
  color: #fff;
  box-shadow: var(--shadow-teal);
}
.btn-secondary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: #E2E8F0; }
.btn-danger {
  background: linear-gradient(135deg, #E53E3E, var(--accent-coral));
  color: #fff;
}

/* ── Form Fields ─────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(26,110,181,0.10);
  background: #fff;
}
.field svg { width: 18px; height: 18px; fill: none; stroke: var(--brand-blue); stroke-width: 2; flex-shrink: 0; opacity: 0.75; }
.field input, .field select {
  flex: 1;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
}
.field input::placeholder { color: var(--text-muted); }
.field select { color: var(--text-muted); }
.field select option { color: var(--text-primary); }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 16px 18px; }

/* ── Section Label ───────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-blue   { background: rgba(26,110,181,0.12); color: var(--brand-blue); }
.badge-teal   { background: rgba(24,184,138,0.12); color: #0E8A64; }
.badge-coral  { background: rgba(240,90,79,0.12);  color: var(--accent-coral); }
.badge-gold   { background: rgba(245,166,35,0.12); color: #C47F00; }
.badge-purple { background: rgba(123,94,167,0.12); color: var(--accent-purple); }

/* ── Avatar ──────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.avatar svg { fill: none; stroke: #fff; stroke-width: 2; }

/* ── Divider ─────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* ── Toast ───────────────────────────────────── */
.toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
