﻿:root {
  --bg: #f6f4ec;
  --surface: #ffffff;
  --surface-soft: #f3f6ef;
  --border: #dce4d4;
  --text: #173221;
  --muted: #667364;
  --primary: #2f6b47;
  --primary-strong: #215337;
  --primary-soft: #e6f0e8;
  --danger-soft: #fbe5e1;
  --danger: #9a3f34;
  --warning-soft: #f7efe0;
  --warning: #9a6a22;
  --shadow: 0 14px 32px rgba(35, 59, 43, 0.08);
  --bottom-nav-height: 72px;
  --bottom-nav-offset: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
  font-family: "Vazirmatn", "Shabnam", "IRANSans", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8f6ef 0%, #eef2e7 100%);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 14px calc(var(--bottom-nav-offset) + 12px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.topbar h1 {
  margin: 6px 0 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.topbar-subtitle {
  margin-top: 8px;
  max-width: 38ch;
}

.eyebrow {
  margin: 0;
  color: #9b6a28;
  font-size: 0.88rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-main {
  overflow: visible;
}

.layer {
  min-height: 0;
}

.screen {
  min-height: 0;
  padding-bottom: 0;
}

.public-page-shell {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 14px 28px;
}

.public-page-card {
  display: grid;
  gap: 18px;
}

.public-page-card h1 {
  margin: 0;
  font-size: 1.6rem;
}

.public-page-content {
  display: grid;
  gap: 12px;
  line-height: 1.9;
}

.public-page-content p {
  margin: 0;
}

.public-page-content a,
.public-links a {
  color: var(--primary-strong);
  text-decoration: none;
}

.public-page-list {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 8px;
}

.public-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding-top: 4px;
}

.public-links a {
  font-weight: 600;
}

.guest-public-links {
  justify-content: center;
  padding: 18px 8px 6px;
}

.trustseal-wrap {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.guest-trustseal {
  padding: 4px 8px 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero-block {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.welcome-hero {
  gap: 14px;
}

.welcome-actions {
  margin-bottom: 10px;
}

.welcome-helper {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.95rem;
}

.welcome-points {
  display: grid;
  gap: 10px;
}

.welcome-point {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.hero-mark {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, #5f9f79 100%);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2,
.section-head h3,
.card h2,
.card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.compact-head {
  margin-top: 4px;
}

.stack-form,
.list-stack,
.profile-card,
.detail-card,
.response-card,
.summary-card {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.home-search-card {
  padding: 14px 16px;
}

.home-search-label {
  display: grid;
  gap: 8px;
}

.auth-form {
  gap: 16px;
}

.form-intro {
  margin: -2px 0 2px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.stack-form span {
  font-size: 0.95rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 15px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.primary-btn,
.ghost-btn,
.soft-success-btn,
.danger-light-btn,
.nav-btn,
.feedback-btn,
.pill {
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  transition: 0.15s ease;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(33, 83, 55, 0.18);
  border: 1px solid transparent;
}

.primary-btn:hover,
.primary-btn:focus-visible {
  background: var(--primary-strong);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.soft-success-btn:disabled,
.danger-light-btn:disabled,
.nav-btn:disabled,
.feedback-btn:disabled,
.pill:disabled,
button.is-busy {
  opacity: 0.66;
  cursor: wait;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

button.is-busy {
  position: relative;
}

.ghost-btn,
.nav-btn,
.feedback-btn,
.pill {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: #f7f4ec;
  border-color: #d8d2c2;
}

.soft-success-btn {
  background: #edf6ef;
  color: var(--primary-strong);
  border: 1px solid #c8d8cb;
  font-weight: 700;
}

.soft-success-btn:hover,
.soft-success-btn:focus-visible {
  background: #e2f0e5;
  border-color: #b5ccb9;
}

.danger-light-btn {
  background: #fff7f6;
  color: #b04a3f;
  border: 1px solid #ebc8c2;
  font-weight: 700;
}

.danger-light-btn:hover,
.danger-light-btn:focus-visible {
  background: #fdeeed;
  border-color: #dfb0a8;
}

.primary-btn-wide {
  width: 100%;
}

.auth-switch-note {
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.8;
}

.content-disclaimer {
  margin-top: 10px;
  font-size: 0.9rem;
}

.rules-list {
  margin: 0 0 16px;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
}

.form-error {
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 11px 13px;
  line-height: 1.7;
  margin-top: -4px;
}

.summary-card strong {
  font-size: 1.15rem;
}

.summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7faf4 100%);
}

.need-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.need-card:hover,
.need-card:focus-within {
  transform: translateY(-2px);
  border-color: #c4d5c2;
  box-shadow: 0 18px 34px rgba(35, 59, 43, 0.11);
}

.need-card-body,
.detail-body {
  display: grid;
  gap: 8px;
}

.need-card-meta,
.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-actions,
.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pills,
.detail-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.detail-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  object-fit: cover;
  max-height: 260px;
  background: #f3f5ef;
}

.voice-entry-card {
  margin-bottom: 14px;
}

.voice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.voice-card-head,
.voice-card-meta,
.voice-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.voice-card h3 {
  margin: 0;
  font-size: 1.04rem;
}

.voice-media {
  width: 100%;
}

.voice-status-active {
  background: #e0f0e4;
  color: #2c7844;
}

.voice-status-review {
  background: #f7efe0;
  color: #9a6a22;
}

.voice-status-answered {
  background: #e4eef8;
  color: #285d8d;
}

.voice-status-closed {
  background: #ecebe6;
  color: #5c675a;
}

.response-card {
  border-style: dashed;
}

.response-card.is-selected {
  border-style: solid;
  border-color: #d3c181;
  background: linear-gradient(180deg, #fffef8 0%, #fff9e7 100%);
}

.response-card.is-own {
  border-color: #c8d8cb;
}

.response-author {
  display: grid;
  gap: 4px;
}

.feedback-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px #bfd4c3;
}

.profile-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8faf5 100%);
}

.profile-header {
  display: grid;
  gap: 6px;
}

.profile-note {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.profile-activity-sections {
  display: grid;
  gap: 14px;
}

.profile-activity-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.profile-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-activity-head h3 {
  margin: 0;
  font-size: 1rem;
}

.section-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.section-link-btn:hover,
.section-link-btn:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
}

.preview-list {
  display: grid;
  gap: 10px;
}

.preview-item {
  display: grid;
  gap: 6px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.preview-item h4 {
  margin: 0;
  font-size: 0.96rem;
}

.card-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

@media (max-width: 540px) {
  .meta-pills,
  .detail-inline,
  .need-card-footer,
  .response-actions,
  .section-head {
    align-items: stretch;
  }

  .section-head {
    flex-direction: column;
  }

  .section-head .ghost-btn,
  .section-head .primary-btn,
  .section-head .soft-success-btn,
  .section-head .danger-light-btn,
  .need-card-footer .primary-btn,
  .detail-actions .ghost-btn,
  .activity-card-footer .ghost-btn,
  .response-actions .feedback-btn,
  .manage-actions .ghost-btn,
  .mark-solved-btn {
    width: 100%;
  }
}

.need-card,
.response-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.need-card-header,
.response-card-header,
.detail-meta,
.profile-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.need-card h3,
.response-card h4,
.detail-card h3 {
  margin: 0;
  font-size: 1.06rem;
}

.need-card-footer,
.response-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.badge-status-open {
  background: #fde9e2;
  color: #ae4c3c;
}

.badge-status-solved {
  background: #e0f0e4;
  color: #2c7844;
}

.badge-type {
  background: #e4eef8;
  color: #285d8d;
}

.badge-selected {
  background: #f6eed8;
  color: #8d651f;
}

.meta-line {
  font-size: 0.92rem;
  color: var(--muted);
}

.empty-card {
  text-align: center;
  padding: 24px 18px;
}

.profile-card strong {
  font-size: 1.15rem;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-box {
  background: var(--surface-soft);
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
  display: grid;
  gap: 4px;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-button:hover,
.metric-button:focus-visible {
  transform: translateY(-2px);
  border-color: #c4d5c2;
  box-shadow: 0 14px 28px rgba(35, 59, 43, 0.1);
}

.metric-box strong {
  font-size: 1.25rem;
}

.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.activity-card h3,
.activity-card h4 {
  margin: 0;
  font-size: 1.02rem;
}

.activity-card-header,
.activity-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-card-body {
  display: grid;
  gap: 8px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  position: fixed;
  left: max(14px, env(safe-area-inset-left, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: 0;
  padding-top: 12px;
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(246, 244, 236, 0) 0%, rgba(246, 244, 236, 0.92) 22%, rgba(246, 244, 236, 1) 100%);
  z-index: 30;
}

.nav-btn {
  min-height: 54px;
  font-weight: 700;
  white-space: normal;
  line-height: 1.35;
  font-size: 0.82rem;
}

.nav-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  background: rgba(23, 50, 33, 0.95);
  color: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

@media (max-width: 540px) {
  .app-shell {
    padding: 12px 10px calc(var(--bottom-nav-offset) + 10px);
  }

  .topbar {
    gap: 10px;
  }

  .topbar h1 {
    font-size: 1.3rem;
  }

  .bottom-nav {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    gap: 6px;
    padding-top: 10px;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }

  .card,
  .need-card,
  .response-card {
    border-radius: 18px;
    padding: 14px;
  }

  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-btn {
    min-height: 58px;
    padding: 10px 8px;
    font-size: 0.78rem;
  }
}
