/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #1c2333;
  --border:    #30363d;
  --accent:    #3bdf91;
  --accent-dim:#1a6644;
  --danger:    #f85149;
  --warning:   #e3b341;
  --text:      #e6edf3;
  --text-muted:#8b949e;
  --sidebar-w: 200px;
  --radius:    15px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Light Mode Theme ───────────────────────────────────────── */
body.light-mode {
  --bg:        #f5f7fa;
  --surface:   #ffffff;
  --surface2:  #eef0f4;
  --border:    #d0d7de;
  --accent:    #1a9e5e;
  --accent-dim:#d0f0e0;
  --danger:    #d93025;
  --warning:   #b08000;
  --text:      #1a1f2e;
  --text-muted:#57606a;
}

/* ── Force html and body background to update ───────────────── */
/* html sits above body so it needs its own explicit override    */
body.light-mode,
body.light-mode html {
  background: #f5f7fa;
  color: #1a1f2e;
}

/* ── Layout wrappers ────────────────────────────────────────── */
body.light-mode .layout        { background: #f5f7fa; }
body.light-mode .main          { background: #f5f7fa; }
body.light-mode .page-content  { background: #f5f7fa; }

/* ── Sidebar ────────────────────────────────────────────────── */
body.light-mode .sidebar       { background: #ffffff; border-color: #d0d7de; }
body.light-mode .sidebar-brand h1 { color: #1a1f2e; }
body.light-mode .sidebar-brand span { color: #57606a; }
body.light-mode .sidebar-nav a { color: #57606a; }
body.light-mode .sidebar-nav a:hover,
body.light-mode .sidebar-nav a.active { background: #eef0f4; color: #1a1f2e; }

/* ── Topbar ─────────────────────────────────────────────────── */
body.light-mode .topbar        { background: #f5f7fa; border-color: #d0d7de; }
body.light-mode .topbar-title  { color: #1a1f2e; }
body.light-mode .topbar-user   { background: #eef0f4; border-color: #d0d7de; }
body.light-mode .user-name     { color: #1a1f2e; }

/* ── Cards ──────────────────────────────────────────────────── */
body.light-mode .card          { background: #ffffff; border-color: #d0d7de; }
body.light-mode .card-title    { color: #57606a; }
body.light-mode .stat-card     { background: #ffffff; border-color: #d0d7de; }

/* ── Table ──────────────────────────────────────────────────── */
body.light-mode table          { background: #ffffff; }
body.light-mode thead th       { color: #57606a; border-color: #d0d7de; }
body.light-mode tbody tr       { border-color: #d0d7de; }
body.light-mode tbody tr:hover { background: #eef0f4; }
body.light-mode td             { color: #1a1f2e; }

/* ── Buttons ────────────────────────────────────────────────── */
body.light-mode .btn-ghost     { color: #57606a; border-color: #d0d7de; }
body.light-mode .btn-ghost:hover { background: #eef0f4; color: #1a1f2e; }

/* ── Forms ──────────────────────────────────────────────────── */
body.light-mode .form-input    { background: #eef0f4; border-color: #d0d7de; color: #1a1f2e; }
body.light-mode .form-label    { color: #57606a; }

/* ── Modals ─────────────────────────────────────────────────── */
body.light-mode .modal         { background: #ffffff; border-color: #d0d7de; }
body.light-mode .modal-title   { color: #1a1f2e; }
body.light-mode .modal-overlay { background: rgba(0, 0, 0, 0.4); }

/* ── Flash messages ─────────────────────────────────────────── */
body.light-mode .flash.success { background: rgba(26,158,94,0.1);  border-color: rgba(26,158,94,0.3);  color: #1a9e5e; }
body.light-mode .flash.error   { background: rgba(217,48,37,0.1);  border-color: rgba(217,48,37,0.3);  color: #d93025; }

/* ── Smooth transition on ALL elements when toggling ────────── */
/* This ensures nothing flashes abruptly when switching modes   */
body, body * {
  transition: background 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0, 10px;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  padding: 0;
}

.sidebar-brand h1 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
}

.sidebar-brand span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-nav a.active .nav-icon { color: var(--accent); }

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 20px 20px 10px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0;
  transition: color 0.15s;
}

.sidebar-footer a:hover { color: var(--accent); }

/* ── Main Content ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 36px; flex: 1; }

/* ── Flash Messages ─────────────────────────────────────────── */
.flash-container {
  padding: 0 36px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
}

.flash.success {
  background: rgba(59, 223, 145, 0.1);
  border: 1px solid rgba(59, 223, 145, 0.3);
  color: var(--accent);
}

.flash.error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--danger);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent-dim); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--border));
}

.stat-card.green  { --accent-color: var(--accent); }
.stat-card.red    { --accent-color: var(--danger); }
.stat-card.yellow { --accent-color: var(--warning); }
.stat-card.blue   { --accent-color: #58a6ff; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-value.green  { color: var(--accent); }
.stat-value.red    { color: var(--danger); }
.stat-value.yellow { color: var(--warning); }
.stat-value.blue   { color: #58a6ff; }

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Grid Layouts ───────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.settings-danger {
  grid-column: 1 / -1;
  width: calc((100% - 20px) / 2);
  justify-self: center;
}

@media (max-width: 800px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-danger {
    grid-column: auto;
    width: 100%;
  }
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

td { padding: 13px 14px; vertical-align: middle; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.98); }

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

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.btn-danger:hover { background: rgba(248, 81, 73, 0.25); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 223, 145, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  cursor: pointer;
}

input[type="date"].form-input,
input[type="month"].form-input {
  color-scheme: dark;
}

body.light-mode input[type="date"].form-input,
body.light-mode input[type="month"].form-input {
  color-scheme: light;
}

/* ── Month History, Filters & Category Budgets ─────────────── */
.month-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.month-toolbar strong {
  margin-left: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-picker label {
  color: var(--text-muted);
  font-size: 12px;
}

.month-picker .form-input {
  width: auto;
  min-width: 155px;
  padding: 7px 10px;
}

.expense-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 0.75fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}

.filter-field .form-label {
  margin-bottom: 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}

.budget-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.budget-progress-item {
  --budget-color: var(--accent);
}

.budget-progress-item.warning {
  --budget-color: var(--warning);
}

.budget-progress-item.over {
  --budget-color: var(--danger);
}

.budget-progress-item strong,
.budget-progress-item span {
  font-size: 13px;
}

.budget-progress-item span {
  color: var(--text-muted);
}

.budget-track {
  height: 7px;
  margin: 9px 0 5px;
  overflow: hidden;
  background: var(--surface2);
  border-radius: 999px;
}

.budget-fill {
  height: 100%;
  background: var(--budget-color);
  border-radius: inherit;
}

.budget-progress-item small {
  color: var(--budget-color);
  font-size: 11px;
}

.budget-form-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.settings-budget-list {
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.settings-budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.settings-budget-row strong,
.settings-budget-row small {
  display: block;
}

.settings-budget-row strong {
  font-size: 14px;
}

.settings-budget-row small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 1000px) {
  .expense-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    align-self: end;
  }
}

@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .expense-filters,
  .budget-progress-grid {
    grid-template-columns: 1fr;
  }

  .month-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .stat-grid,
  .budget-form-row {
    grid-template-columns: 1fr !important;
  }

  .month-toolbar strong {
    width: 100%;
    order: -1;
    margin-left: 0;
  }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Misc Utilities ─────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-sm     { font-size: 13px; }
.mb-4        { margin-bottom: 16px; }
.mb-6        { margin-bottom: 24px; }
.flex        { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3       { gap: 12px; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Topbar User Block ───────────────────────────────────────── */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d1117;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* Beating heart animation */
.footer-heart {
  color: #f85149;
  display: inline-block;
  animation: heartbeat 1.2s ease infinite;
}

@keyframes heartbeat {
  0%   { transform: scale(1);    }
  14%  { transform: scale(1.3);  }
  28%  { transform: scale(1);    }
  42%  { transform: scale(1.3);  }
  70%  { transform: scale(1);    }
  100% { transform: scale(1);    }
}

/* Light mode override */
body.light-mode .app-footer { border-color: #d0d7de; color: #57606a; }

/* Footer link */
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Contact Page ───────────────────────────────────────────── */
.contact-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.contact-form-card,
.contact-info-card {
  border: 1px solid var(--border);
  border-radius: 24px;
}

.contact-form-card {
  background: var(--surface);
  padding: clamp(24px, 3vw, 38px);
}

.contact-heading {
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.contact-eyebrow,
.contact-info-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-heading h1 {
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.contact-heading p {
  max-width: 650px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.contact-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.contact-field label {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--text-muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-input {
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
}

.contact-input::placeholder {
  color: var(--text-muted);
  opacity: 0.78;
}

.contact-input:hover {
  border-color: var(--border);
}

.contact-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 223, 145, 0.12);
}

select.contact-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 42px;
}

select.contact-input option {
  background: var(--surface2);
  color: var(--text);
}

.contact-message-field {
  margin-top: 14px;
}

textarea.contact-input {
  min-height: 125px;
  padding: 14px 18px;
  border-radius: 20px;
  line-height: 1.65;
  resize: vertical;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 25px;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  color: #0d1117;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(59, 223, 145, 0.13);
}

.contact-submit:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.contact-submit:active {
  transform: translateY(0);
}

.contact-info-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 223, 145, 0.18), transparent 34%),
    var(--accent-dim);
  border-color: rgba(59, 223, 145, 0.24);
  overflow: hidden;
}

.contact-info-intro h2 {
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.contact-info-intro p {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.contact-info-list {
  margin-top: 24px;
}

.contact-info-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(230, 237, 243, 0.14);
  color: var(--text);
  text-decoration: none;
}

.contact-info-item:first-child {
  border-top: 0;
}

.contact-info-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(13, 17, 23, 0.22);
  border: 1px solid rgba(230, 237, 243, 0.1);
  border-radius: 13px;
  color: var(--accent);
}

.contact-info-item small,
.contact-info-item strong {
  display: block;
}

.contact-info-item small {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-info-item strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.contact-info-arrow {
  color: var(--text-muted);
}

a.contact-info-item:hover .contact-info-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

body.light-mode .contact-form-card {
  background: #ffffff;
}

body.light-mode .contact-input {
  background-color: #eef0f4;
  color: #1a1f2e;
}

body.light-mode select.contact-input option {
  background: #eef0f4;
  color: #1a1f2e;
}

body.light-mode .contact-info-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 158, 94, 0.2), transparent 34%),
    #d0f0e0;
  border-color: rgba(26, 158, 94, 0.26);
}

body.light-mode .contact-info-icon {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(26, 31, 46, 0.08);
}

body.light-mode .contact-info-item {
  border-color: rgba(26, 31, 46, 0.1);
}

@media (max-width: 1100px) {
  .contact-shell {
    grid-template-columns: 1fr;
  }

  .contact-info-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) 1fr;
    gap: 40px;
  }

  .contact-info-list {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .contact-fields {
    grid-template-columns: 1fr;
  }

  .contact-info-card {
    display: block;
  }

  .contact-info-list {
    margin-top: 30px;
  }
}

@media (max-width: 520px) {
  .contact-form-card,
  .contact-info-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .contact-heading {
    padding-bottom: 22px;
    margin-bottom: 24px;
  }

  textarea.contact-input {
    min-height: 160px;
    border-radius: 18px;
  }

  .contact-submit {
    width: 100%;
  }
}
