:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-soft: #f0f0ec;
  --text: #171717;
  --muted: #70706b;
  --border: #e2e2dc;
  --dark: #181a18;
  --accent: #20885c;
  --accent-dark: #166a46;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

main {
  min-height: calc(100vh - 150px);
}

.page-container,
.nav-container,
.footer-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}


/* NAV */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.nav-container {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  color: #4a4a46;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--text);
}

.nav-user {
  font-size: 14px;
  color: var(--muted);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.signup-button {
  background: var(--dark);
  color: white;
}

.logout-button {
  background: #eeeeea;
  color: #333;
}


/* FLASH */

.flash-container {
  width: min(1180px, calc(100% - 40px));
  margin: 14px auto 0;
}

.flash-message {
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14px;
}

.flash-success {
  background: #e9f8ef;
  color: #17633e;
}

.flash-error {
  background: #fdecec;
  color: #a52b2b;
}


/* HERO */

.hero {
  padding: 75px 0 70px;
  background:
    radial-gradient(
      circle at 85% 10%,
      rgba(40, 145, 97, 0.11),
      transparent 34%
    ),
    linear-gradient(180deg, #ffffff 0%, #f7f7f3 100%);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 70px;
}

.hero-kicker,
.section-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.hero h1 {
  max-width: 700px;
  margin: 0 0 22px;
  font-size: clamp(47px, 6vw, 75px);
  line-height: 0.98;
  letter-spacing: -3.8px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-copy > p {
  max-width: 590px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 0 23px;
  border-radius: 11px;
  background: var(--dark);
  color: white;
  text-decoration: none;
  font-weight: 750;
}

.hero-card {
  padding: 30px;
  display: flex;
  gap: 18px;
  background: var(--dark);
  color: white;
  border-radius: 24px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.14);
}

.hero-card-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 25px;
}

.hero-card strong {
  font-size: 18px;
}

.hero-card p {
  margin: 7px 0 0;
  color: #bfc2bc;
  line-height: 1.55;
}


/* CAMPAIGN INDEX */

.campaign-section {
  padding: 65px 0 80px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.section-heading h2,
.structure-heading h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -1px;
}

.campaign-count {
  color: var(--muted);
  font-size: 14px;
}

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

.campaign-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.campaign-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.08);
}

.campaign-visual {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.11),
      transparent 35%
    ),
    #202321;
}

.tcg-box {
  width: 120px;
  height: 145px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background: linear-gradient(145deg, #353936, #151715);
  color: white;
  transform: rotate(-4deg);
  box-shadow: 12px 20px 32px rgba(0, 0, 0, 0.33);
}

.tcg-box span {
  color: #9ad8b8;
  font-size: 12px;
  letter-spacing: 3px;
}

.tcg-box strong {
  margin-top: 4px;
  font-size: 24px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.campaign-visual .status-pill {
  position: absolute;
  top: 16px;
  right: 16px;
}

.status-funding {
  background: #e6f8ee;
  color: #187449;
}

.status-funded {
  background: #edf0ff;
  color: #465bb8;
}

.status-opened {
  background: #efecec;
  color: #56504f;
}

.campaign-card-body {
  padding: 23px;
}

.campaign-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.4px;
}

.campaign-description {
  min-height: 45px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #e7e8e4;
  border-radius: 100px;
}

.progress-value {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.progress-text {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-text strong {
  color: var(--accent-dark);
}

.campaign-stats {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.campaign-stats div {
  min-width: 0;
}

.campaign-stats span,
.funding-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.campaign-stats strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.campaign-button,
.login-contribute-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--dark);
  color: white;
  text-decoration: none;
  font-weight: 750;
  font-size: 14px;
}

.empty-state,
.empty-contributions {
  padding: 35px;
  background: var(--surface);
  border: 1px dashed #cacac3;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}


/* DETAIL */

.detail-page {
  padding: 40px 0 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 25px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  color: var(--text);
}

.detail-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.6fr)
    minmax(300px, 0.7fr);
  align-items: start;
  gap: 25px;
}

.detail-main {
  display: grid;
  gap: 24px;
}

.detail-panel,
.funding-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.detail-panel {
  padding: 31px;
}

.detail-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -2px;
}

.detail-description {
  margin: 22px 0 35px;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-line;
}

.case-structure {
  padding-top: 29px;
  border-top: 1px solid var(--border);
}

.structure-heading {
  margin-bottom: 20px;
}

.structure-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.structure-item {
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 13px;
}

.structure-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 27px;
}

.structure-item span {
  color: var(--muted);
  font-size: 12px;
}

.funding-panel {
  position: sticky;
  top: 96px;
  padding: 28px;
}

.big-raised {
  margin-top: 9px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.raised-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.detail-progress {
  margin-top: 25px;
}

.funding-summary {
  margin: 25px 0;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.funding-row {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.funding-row span {
  margin: 0;
  font-size: 13px;
}

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

.coming-next-box,
.funded-box {
  padding: 18px;
  border-radius: 12px;
}

.coming-next-box {
  background: #f1f2ee;
}

.funded-box {
  background: #eaf7ef;
  color: #166642;
}

.coming-next-box p,
.funded-box p {
  margin: 6px 0 0;
  line-height: 1.5;
  font-size: 13px;
}

.contribution-list {
  display: grid;
}

.contribution-item {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.contribution-item:last-child {
  border-bottom: 0;
}

.contribution-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contribution-avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 39px;
  border-radius: 50%;
  background: #e7ebe6;
  color: #26352c;
  font-weight: 800;
}

.contribution-person strong {
  display: block;
  font-size: 14px;
}

.contribution-person span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.contribution-money {
  white-space: nowrap;
  font-size: 14px;
}


/* FOOTER */

.site-footer {
  padding: 30px 0;
  background: #1b1d1b;
  color: #d8dad6;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

.footer-container span {
  color: #91958f;
}


/* RESPONSIVE */

@media (max-width: 900px) {
  .hero-content,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .campaign-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .funding-panel {
    position: static;
  }
}

@media (max-width: 650px) {
  .page-container,
  .nav-container,
  .footer-container {
    width: min(100% - 28px, 1180px);
  }

  .nav-container {
    min-height: 65px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-user,
  .nav-links > .nav-link:first-child {
    display: none;
  }

  .hero {
    padding: 55px 0;
  }

  .hero-content {
    gap: 35px;
  }

  .hero h1 {
    font-size: 47px;
    letter-spacing: -2.5px;
  }

  .campaign-section,
  .detail-page {
    padding-top: 35px;
  }

  .campaign-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel,
  .funding-panel {
    padding: 21px;
    border-radius: 16px;
  }

  .detail-heading-row {
    flex-direction: column;
  }

  .structure-grid {
    grid-template-columns: 1fr;
  }

  .campaign-stats {
    gap: 7px;
  }

  .contribution-item {
    align-items: flex-start;
  }

  .footer-container {
    flex-direction: column;
  }
}

/* CONTRIBUTION FORM */

.contribution-section {
  margin-top: 8px;
}

.contribution-form-heading {
  margin-bottom: 18px;
}

.contribution-form-heading h3 {
  margin: 0 0 7px;
  font-size: 20px;
  letter-spacing: -0.4px;
}

.contribution-form-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.contribution-form {
  display: grid;
  gap: 15px;
}

.amount-field {
  display: grid;
  gap: 8px;
}

.amount-label {
  font-size: 13px;
  font-weight: 700;
}

.amount-input-wrapper {
  min-height: 50px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: white;
  border: 1px solid #d6d7d2;
  border-radius: 11px;
}

.amount-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 136, 92, 0.1);
}

.currency-prefix {
  padding: 0 12px 0 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-right: 1px solid var(--border);
}

.amount-input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.amount-help {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.contribute-button {
  min-height: 49px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.contribute-button:hover {
  background: var(--accent-dark);
}

.mock-payment-note {
  margin: -2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.form-error-box {
  margin-bottom: 16px;
  padding: 14px 15px;
  background: #fff0f0;
  border: 1px solid #f0cccc;
  border-radius: 10px;
  color: #9b2929;
  font-size: 12px;
}

.form-error-box strong {
  display: block;
  margin-bottom: 7px;
}

.form-error-box ul {
  margin: 0;
  padding-left: 18px;
}

.form-error-box li + li {
  margin-top: 4px;
}

.login-required-box {
  display: grid;
  gap: 9px;
  padding: 18px;
  background: #f1f2ee;
  border-radius: 12px;
}

.login-required-box p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ADMIN */

.admin-page {
  padding: 45px 0 80px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 28px;
}

.admin-header h1,
.admin-form-card h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: -1.4px;
}

.admin-header p,
.admin-form-description {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-primary-button,
.admin-secondary-button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

.admin-primary-button {
  background: var(--dark);
  color: white;
}

.admin-secondary-button {
  background: #eeeeea;
  color: var(--text);
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-nav-link {
  padding: 10px 15px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.admin-nav-link.active {
  background: var(--dark);
  color: white;
}

.admin-table-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #f5f5f2;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 13px;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-actions {
  min-width: 170px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-action-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.admin-open-button {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #e8f7ee;
  color: #136740;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.admin-muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-form-container {
  max-width: 850px;
}

.admin-form-card {
  padding: 32px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
}

.admin-form {
  margin-top: 30px;
  display: grid;
  gap: 20px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.admin-form-grid.admin-three {
  grid-template-columns: repeat(3, 1fr);
}

.admin-field {
  display: grid;
  gap: 8px;
}

.admin-field label {
  font-size: 13px;
  font-weight: 700;
}

.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d6d7d2;
  border-radius: 9px;
  outline: none;
  background: white;
}

.admin-field input:focus,
.admin-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 136, 92, 0.10);
}

.admin-form-actions {
  padding-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 700px) {
  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-form-grid,
  .admin-form-grid.admin-three {
    grid-template-columns: 1fr;
  }

  .admin-form-card {
    padding: 22px;
  }
}
/* AUTH — migrated from the Django prototype */
.auth-wrapper {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 15px 45px rgba(16, 24, 40, 0.06);
}

.auth-card h1 {
  margin: 8px 0 8px;
  font-size: 32px;
  letter-spacing: -1px;
}

.auth-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: #667085;
  line-height: 1.6;
  font-size: 14px;
}

.auth-form {
  margin-top: 24px;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.auth-field-hint {
  display: block;
  margin: -3px 0 7px;
  color: #98a2b3;
  font-size: 11px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #101828;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 136, 92, 0.10);
}

.auth-remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 18px;
  color: #667085;
  font-size: 12px;
  cursor: pointer;
}

.auth-remember-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.auth-submit-btn {
  width: 100%;
  margin-top: 4px;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.auth-submit-btn:hover {
  background: var(--accent-dark);
}

.auth-secondary-link {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
}

.auth-secondary-link a,
.auth-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.auth-footer {
  margin-top: 22px;
  text-align: center;
  color: #667085;
  font-size: 13px;
}

.auth-error-box {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  line-height: 1.5;
}

.auth-error-box div + div {
  margin-top: 4px;
}

@media (max-width: 520px) {
  .auth-wrapper {
    align-items: flex-start;
    padding: 32px 14px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .auth-card h1 {
    font-size: 28px;
  }
}
