/* ===== EzyBudgeting design system ===== */

:root {
  --ezy-ink: #141b2d;
  --ezy-ink-soft: #5b6478;
  --ezy-primary: #4338ca;
  --ezy-primary-dark: #312693;
  --ezy-primary-soft: #eceafd;
  --ezy-accent: #0d9488;
  --ezy-accent-soft: #e3f6f3;
  --ezy-danger: #dc2626;
  --ezy-danger-soft: #fdecec;
  --ezy-success: #15803d;
  --ezy-success-soft: #e9f8ee;
  --ezy-warning: #b45309;
  --ezy-warning-soft: #fef3e0;
  --ezy-bg: #f4f5fb;
  --ezy-surface: #ffffff;
  --ezy-border: #e4e6f1;
  --ezy-radius: 14px;
  --ezy-radius-sm: 10px;
  --ezy-shadow: 0 1px 2px rgba(20, 27, 45, 0.04), 0 8px 24px -12px rgba(20, 27, 45, 0.12);
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ezy-bg);
  color: var(--ezy-ink);
}

/* ---------- Header / nav ---------- */

.ezy-header {
  background: var(--ezy-surface);
  border-bottom: 1px solid var(--ezy-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.ezy-header .navbar {
  min-height: 64px;
}

.ezy-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ezy-ink) !important;
  text-decoration: none;
}

.ezy-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ezy-primary), var(--ezy-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.ezy-nav-link {
  color: var(--ezy-ink-soft) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.4rem 0.75rem !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ezy-nav-link:hover,
.ezy-nav-link.active {
  color: var(--ezy-primary) !important;
  background: var(--ezy-primary-soft);
}

.ezy-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ezy-ink-soft);
  font-size: 0.9rem;
}

.ezy-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ezy-primary-soft);
  color: var(--ezy-primary);
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Page shell ---------- */

.ezy-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.ezy-page h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.ezy-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ezy-primary);
}

.ezy-subtitle {
  color: var(--ezy-ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ---------- Alerts ---------- */

.alert {
  border: 1px solid transparent;
  border-radius: var(--ezy-radius-sm);
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
}

.alert-success {
  background: var(--ezy-success-soft);
  border-color: #bfe6cb;
  color: var(--ezy-success);
}

.alert-info {
  background: var(--ezy-primary-soft);
  border-color: #cfc9f7;
  color: var(--ezy-primary-dark);
}

.alert-danger {
  background: var(--ezy-danger-soft);
  border-color: #f4c4c4;
  color: var(--ezy-danger);
}

/* ---------- Cards / surfaces ---------- */

.card {
  background: var(--ezy-surface);
  border: 1px solid var(--ezy-border);
  border-radius: var(--ezy-radius);
  box-shadow: var(--ezy-shadow);
}

.ezy-panel {
  background: var(--ezy-surface);
  border: 1px solid var(--ezy-border);
  border-radius: var(--ezy-radius);
  box-shadow: var(--ezy-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ezy-panel-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.ezy-panel-step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ezy-primary-soft);
  color: var(--ezy-primary);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ---------- Stat tiles ---------- */

.ezy-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
  .ezy-stat-row {
    grid-template-columns: 1fr;
  }
}

.ezy-stat {
  background: var(--ezy-surface);
  border: 1px solid var(--ezy-border);
  border-radius: var(--ezy-radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--ezy-shadow);
}

.ezy-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ezy-ink-soft);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.ezy-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ezy-stat-value.is-balanced {
  color: var(--ezy-success);
}

.ezy-stat-value.is-unbalanced {
  color: var(--ezy-danger);
}

/* ---------- Buttons ---------- */

.btn {
  border-radius: var(--ezy-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.btn-primary {
  background: var(--ezy-primary);
  border-color: var(--ezy-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--ezy-primary-dark);
  border-color: var(--ezy-primary-dark);
}

.btn-success {
  background: var(--ezy-accent);
  border-color: var(--ezy-accent);
}

.btn-success:hover,
.btn-success:focus {
  background: #0b7a70;
  border-color: #0b7a70;
}

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

.btn-outline-primary:hover {
  background: var(--ezy-primary);
  border-color: var(--ezy-primary);
}

.btn-outline-secondary {
  color: var(--ezy-ink-soft);
  border-color: var(--ezy-border);
}

.btn-outline-secondary:hover {
  background: var(--ezy-bg);
  color: var(--ezy-ink);
  border-color: var(--ezy-border);
}

.btn-outline-danger {
  --bs-btn-color: var(--ezy-danger);
  --bs-btn-border-color: #f1b9b9;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem var(--ezy-primary-soft);
}

/* ---------- Forms ---------- */

label.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ezy-ink-soft);
  margin-bottom: 0.3rem;
}

.form-control,
.form-select {
  border-radius: var(--ezy-radius-sm);
  border-color: var(--ezy-border);
  font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ezy-primary);
  box-shadow: 0 0 0 0.2rem var(--ezy-primary-soft);
}

/* ---------- Badges / pills ---------- */

.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  padding: 0.35em 0.65em;
  border-radius: 999px;
}

.badge.bg-success {
  background: var(--ezy-success-soft) !important;
  color: var(--ezy-success) !important;
}

.badge.bg-secondary {
  background: var(--ezy-primary-soft) !important;
  color: var(--ezy-primary) !important;
}

.badge.bg-light {
  background: var(--ezy-bg) !important;
  color: var(--ezy-ink-soft) !important;
}

/* ---------- Tables ---------- */

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ezy-ink-soft);
  font-weight: 700;
  border-bottom-width: 1px;
  border-color: var(--ezy-border);
}

.table td,
.table th {
  border-color: var(--ezy-border);
  vertical-align: middle;
}

/* ---------- Cost line cards ---------- */

.ezy-line-card {
  border: 1px solid var(--ezy-border);
  border-radius: var(--ezy-radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  background: var(--ezy-surface);
}

.ezy-line-card .ezy-line-heading {
  font-weight: 700;
}

.ezy-group-heading {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.ezy-group-heading .ezy-group-total {
  font-weight: 600;
  color: var(--ezy-ink-soft);
  font-size: 0.88rem;
}

.ezy-remaining-ok {
  color: var(--ezy-success);
  font-weight: 700;
}

.ezy-remaining-bad {
  color: var(--ezy-danger);
  font-weight: 700;
}

/* ---------- Footer ---------- */

footer.ezy-footer {
  color: var(--ezy-ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 0 3rem;
}

footer.ezy-footer a {
  color: var(--ezy-ink-soft);
}

/* ---------- Auth screen ---------- */

.ezy-auth-shell {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.ezy-auth-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  max-width: 920px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--ezy-shadow);
}

@media (max-width: 860px) {
  .ezy-auth-grid {
    grid-template-columns: 1fr;
  }
  .ezy-auth-hero {
    display: none;
  }
}

.ezy-auth-hero {
  background: radial-gradient(circle at 15% 20%, #5b4fe0 0%, var(--ezy-primary) 45%, var(--ezy-primary-dark) 100%);
  color: #fff;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ezy-auth-hero h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.ezy-auth-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ezy-auth-hero-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.ezy-auth-hero-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  font-size: 0.88rem;
}

.ezy-auth-hero-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.85);
}

.ezy-auth-form {
  background: var(--ezy-surface);
  padding: 3rem 2.5rem;
}

.ezy-auth-form h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.ezy-auth-form .ezy-subtitle {
  margin-bottom: 1.75rem;
}

.ezy-demo-accounts {
  margin-top: 1.75rem;
  border-top: 1px dashed var(--ezy-border);
  padding-top: 1.25rem;
}

.ezy-demo-accounts summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ezy-ink-soft);
}

.ezy-demo-account-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.4rem;
}

.ezy-demo-account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  background: var(--ezy-bg);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.ezy-demo-account code {
  color: var(--ezy-primary-dark);
  font-size: 0.78rem;
}

.ezy-demo-account .ezy-role-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ezy-ink-soft);
}
