/* ===== CSS RESET & ROOT ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Primary Navy */
  --primary: #0d47a1;
  --primary-container: #d1e4ff;
  --on-primary: #ffffff;
  --on-primary-container: #001d40;
  /* Secondary Teal */
  --secondary: #008080;
  --secondary-container: #cce5e5;
  --on-secondary: #ffffff;
  --on-secondary-container: #002020;
  /* Tertiary */
  --tertiary: #4dd0e1;
  /* Surface */
  --surface: #fdfbff;
  --on-surface: #1a1c1e;
  --surface-variant: #dfe2eb;
  --on-surface-variant: #43474e;
  --outline: #73777f;
  /* Misc */
  --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.14);
  --elevation-2: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  background: #e8e8e8;
}

/* ===== MOBILE FRAME ===== */
#app-frame {
  width: 412px;
  height: 917px;
  margin: 16px auto;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

/* ===== TYPOGRAPHY (M3 scale subset) ===== */
.display-large {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.25px;
}

.headline-medium {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.28;
}

.title-large {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.27;
}

.title-medium {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.15px;
}

.body-large {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.body-medium {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: 0.25px;
}

.label-large {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.43;
  letter-spacing: 0.1px;
}

/* ===== TOP APP BAR ===== */
.top-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.top-app-bar .leading,
.top-app-bar .trailing {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: background 0.2s;
}

.top-app-bar .leading:hover,
.top-app-bar .trailing:hover {
  background: var(--surface-variant);
}

.top-app-bar .bar-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
}

.top-app-bar .app-logo {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

.top-app-bar .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--on-primary-container);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 80px;
  background: var(--surface);
  border-top: 1px solid var(--surface-variant);
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-shrink: 0;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: var(--radius-lg);
  transition: background 0.2s;
  text-decoration: none;
  color: var(--on-surface-variant);
  position: relative;
}

.bottom-nav .nav-item:hover {
  background: var(--surface-variant);
}

.bottom-nav .nav-item.active {
  color: var(--primary);
}

.bottom-nav .nav-item.active .nav-indicator {
  position: absolute;
  top: 4px;
  width: 56px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-container);
  z-index: -1;
}

.bottom-nav .nav-item .nav-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ===== SCREEN SCROLL ===== */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--elevation-1);
}

.btn-primary:hover {
  box-shadow: var(--elevation-2);
  filter: brightness(1.08);
}

.btn-teal {
  background: var(--secondary);
  color: var(--on-secondary);
  box-shadow: var(--elevation-1);
}

.btn-teal:hover {
  box-shadow: var(--elevation-2);
  filter: brightness(1.08);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 0 12px;
  height: 40px;
}

.btn-text:hover {
  background: rgba(13, 71, 161, 0.08);
}

.btn-outlined {
  background: transparent;
  border: 1px solid var(--outline);
  color: var(--primary);
}

.btn-outlined:hover {
  background: rgba(13, 71, 161, 0.06);
}

.btn-container {
  background: var(--primary-container);
  color: var(--on-primary-container);
  box-shadow: var(--elevation-1);
}

.btn-container:hover {
  box-shadow: var(--elevation-2);
  filter: brightness(0.97);
}

.btn-full {
  width: 100%;
  max-width: 340px;
}

.btn-fab {
  height: 56px;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== CARDS ===== */
.card-elevated {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
  overflow: hidden;
}

.card-outlined {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-body {
  padding: 16px;
}

/* ===== SNACKBAR ===== */
.snackbar {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #323232;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE FALLBACK ===== */
@media (max-width: 440px) {
  #app-frame {
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ===== RIPPLE ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 50%),
    rgba(0, 0, 0, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
}

.ripple:active::after {
  opacity: 1;
  transition: opacity 0s;
}

/* ===== UTILITY ===== */
.gap-8 {
  gap: 8px;
}
.mb-4 {
  margin-bottom: 4px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mt-8 {
  margin-top: 8px;
}
.text-center {
  text-align: center;
}
.flex-col {
  display: flex;
  flex-direction: column;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}
