/* ДЕЛИМ — Apple-style light theme. Brand color = green (#1aa463), остальное —
   палитра apple.com: тонкие сепараторы, мягкие тени, крупные радиусы. */

@font-face { font-family: 'Inter'; src: url('https://fonts.cdnfonts.com/s/19795/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('https://fonts.cdnfonts.com/s/19795/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('https://fonts.cdnfonts.com/s/19795/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('https://fonts.cdnfonts.com/s/19795/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --brand: #1aa463;
  --brand-hover: #168b53;
  --brand-soft: rgba(26,164,99,0.10);
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fbfbfd;
  --label-primary: #1d1d1f;
  --label-secondary: #6e6e73;
  --label-tertiary: #86868b;
  --label-quaternary: #d2d2d7;
  --separator: rgba(0,0,0,0.08);
  --separator-soft: rgba(0,0,0,0.05);
  --system-red: #d70015;
  --system-green: #1aa463;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-elev: 0 4px 12px rgba(0,0,0,0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 980px;
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-secondary);
  color: var(--label-primary);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.02em; color: var(--label-primary); }
h3 { font-size: 1.7rem; }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.1rem; }
small, .small { font-size: 0.78rem; }
.text-muted { color: var(--label-tertiary) !important; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

/* Navbar — flat, glassy */
.app-nav {
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-inner { display: flex; justify-content: space-between; align-items: center; max-width: 920px; margin: 0 auto; padding: 0 20px; }
.app-brand {
  font-weight: 800; color: var(--brand);
  font-size: 1.1rem; letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1;
}
.app-brand:hover { color: var(--brand-hover); text-decoration: none; }
.app-by {
  font-size: 0.5rem;
  color: #1d1d1f;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
  text-transform: none;
}
.app-user { display: flex; align-items: center; gap: 12px; }
.app-user-name { color: var(--label-secondary); font-size: 0.86rem; font-weight: 500; }

/* Container */
main.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* Cards — apple style: white, soft shadow, big radius */
.card {
  background: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  transition: box-shadow .18s, transform .18s;
}
.card.tight { padding: 14px 16px; }
.card-title { font-weight: 600; font-size: 0.95rem; color: var(--label-primary); margin-bottom: 12px; }

.group-card {
  display: block;
  text-decoration: none;
  color: var(--label-primary);
}
.group-card:hover {
  text-decoration: none;
  color: var(--label-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elev);
}

/* Buttons — pill, apple-style */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 500;
  padding: 9px 22px;
  font-size: 0.92rem;
  border: 0.5px solid transparent;
  transition: all .15s;
  letter-spacing: -0.005em;
}
.btn:focus { box-shadow: none; outline: none; }
.btn-brand {
  background: var(--brand);
  color: #fff;
}
.btn-brand:hover { background: var(--brand-hover); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--label-primary);
  border-color: var(--separator);
}
.btn-outline:hover { background: var(--bg-tertiary); }
.btn-link-soft {
  background: transparent;
  color: var(--brand);
  padding: 6px 14px;
}
.btn-link-soft:hover { color: var(--brand-hover); }
.btn-icon {
  background: var(--bg-tertiary);
  border: 0.5px solid var(--separator);
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--label-secondary);
}
.btn-icon:hover { background: var(--bg-secondary); color: var(--label-primary); }
.btn-sm { padding: 5px 14px; font-size: 0.84rem; }

/* Inputs — apple style */
.form-control, .form-select {
  background: var(--bg-tertiary);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--label-primary);
  transition: border-color .15s, background .15s;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--bg-primary);
}
.form-label { font-size: 0.74rem; color: var(--label-tertiary); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }

/* Form check (checkbox/radio) */
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }

/* Dividers and rows */
.row-divider { border-bottom: 0.5px solid var(--separator-soft); padding: 12px 0; }
.row-divider:last-child { border-bottom: none; }

.expense-row { padding: 14px 0; border-bottom: 0.5px solid var(--separator-soft); }
.expense-row:last-child { border-bottom: none; }
.expense-title { font-weight: 600; font-size: 0.96rem; }
.expense-meta { color: var(--label-tertiary); font-size: 0.78rem; margin-top: 2px; }
.expense-amount { font-weight: 600; font-size: 1.05rem; }

/* Balance pills */
.balance-pos { color: var(--system-green); font-weight: 600; }
.balance-neg { color: var(--system-red); font-weight: 600; }
.balance-zero { color: var(--label-tertiary); }

/* Empty state */
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--label-tertiary);
}
.empty i { font-size: 2.4rem; color: var(--label-quaternary); display: block; margin-bottom: 10px; }

/* Modal — apple sheet style */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
}
.modal-header { border-bottom: 0.5px solid var(--separator); padding: 18px 22px; }
.modal-title { font-weight: 600; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 0.5px solid var(--separator); padding: 14px 22px; }

/* Alerts */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  padding: 12px 16px;
  font-size: 0.88rem;
}
.alert-danger { background: rgba(215,0,21,0.08); color: var(--system-red); }

/* Hero (auth pages) */
.auth-card {
  max-width: 380px;
  margin: 60px auto;
  padding: 32px 32px 28px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.auth-title {
  font-weight: 700;
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.auth-switch {
  text-align: center;
  margin-top: 18px;
  color: var(--label-tertiary);
  font-size: 0.86rem;
}

/* Members pills (group page) */
.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  margin: 2px 4px 2px 0;
}

/* Mobile */
@media (max-width: 640px) {
  main.container { padding: 16px 14px 32px; }
  .card { padding: 16px 18px; border-radius: var(--radius-sm); }
  h4 { font-size: 1.15rem; }
  .auth-card { margin: 24px auto; padding: 24px 22px; }
  .btn { padding: 8px 18px; font-size: 0.88rem; }
  .app-nav-inner { padding: 0 14px; }
}
