:root {
  --bg: #7d7854;
  --bg-soft: #737357;
  --surface: #b19a80;
  --surface-2: #bba085;
  --text: #2f2b24;
  --muted: #5a5a40;
  --accent: #5a5a40;
  --accent-strong: #737357;
  --accent-soft: #ceb7a0;
  --border: #9c886f;
  --danger: #bb4a46;
  --danger-strong: #9f3b38;
  --shadow: 0 14px 34px rgba(112, 94, 69, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: "Sora", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(90, 90, 64, 0.42) 0%, transparent 46%),
    radial-gradient(circle at 88% 11%, rgba(115, 115, 87, 0.38) 0%, transparent 42%),
    linear-gradient(180deg, #5a5a40 0%, #737357 34%, #7d7854 58%, #b19a80 82%, #ceb7a0 100%);
}

body::before {
  content: none;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(10px);
}

.orb-one {
  top: -95px;
  right: 5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 40% 40%, rgba(87, 121, 84, 0.48), transparent 70%);
}

.orb-two {
  left: -80px;
  bottom: 10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle at 50% 50%, rgba(124, 149, 97, 0.46), transparent 72%);
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0.012em;
}

h1 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(1.65rem, 2vw, 2.15rem);
  color: #f5efe4;
}

h2 {
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: #e7d8c4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: #f0e5d5;
  font-size: 0.93rem;
}

.grid {
  padding: 1.35rem 0 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  animation: enter-up 440ms ease both;
}

.card:nth-child(2) {
  animation-delay: 80ms;
}

.card:nth-child(3) {
  animation-delay: 140ms;
}

.card:nth-child(4) {
  animation-delay: 180ms;
}

.card p {
  color: var(--muted);
  margin-top: 0.55rem;
}

.full {
  grid-column: 1 / -1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-weight: 600;
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  background: #d9cab6;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8e8f86;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 138, 112, 0.2);
  background: #e8ddd0;
}

textarea {
  resize: vertical;
}

.btn {
  border: 1px solid rgba(109, 138, 112, 0.5);
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #f6f9f4;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(109, 138, 112, 0.24);
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  border-color: rgba(127, 114, 93, 0.52);
  color: #40382e;
  background: linear-gradient(140deg, #d8c3a8 0%, #cbb293 100%);
}

.text-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #3f4938;
  padding: 0.1rem 0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
  cursor: pointer;
}

.text-btn:hover {
  color: #2f372a;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: #f2e7d8;
  font-size: 0.87rem;
}

.muted {
  color: var(--muted);
}

.listing {
  border: 1px solid #c8b9a4;
  border-radius: 12px;
  padding: 0.85rem;
  background: linear-gradient(180deg, #d6e3d4 0%, #d9c9b3 100%);
}

.listing h3 {
  margin: 0;
  font-size: 1rem;
}

.listing .meta {
  margin: 0.45rem 0;
  font-size: 0.85rem;
  color: #7c7162;
}

.listing p:last-child {
  margin-bottom: 0;
}

.ads-feature {
  transition: opacity 160ms ease, border-color 160ms ease;
}

.ads-feature.is-disabled {
  opacity: 0.88;
}

.ads-feature.is-disabled #ads-feature-content {
  display: none;
}

.ads-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flag-toggle {
  border: 1px solid rgba(122, 111, 92, 0.56);
  background: #d9cab7;
  color: #585147;
  border-radius: 999px;
  padding: 0.26rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.flag-toggle:hover {
  color: #37332d;
  border-color: rgba(129, 146, 117, 0.64);
}

.flag-toggle.on {
  color: #eff8f1;
  border-color: rgba(109, 138, 112, 0.72);
  background: #6d8a70;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  max-width: 90vw;
  background: #38342f;
  border: 1px solid rgba(216, 200, 174, 0.5);
  color: #f5eee3;
  padding: 0.8rem 0.95rem;
  border-radius: 11px;
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease;
}

.toast.error {
  background: #6d2e2c;
  border-color: rgba(235, 175, 169, 0.45);
  color: #ffe3e1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(88, 76, 59, 0.46);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(460px, 100%);
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid #bfae99;
  background:
    linear-gradient(180deg, rgba(245, 248, 242, 0.4) 0%, transparent 60%),
    #d6e2d4;
  box-shadow: var(--shadow);
  animation: enter-up 240ms ease both;
}

.modal-wide {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
}

.modal-card h3 {
  margin: 0;
}

.modal-card p {
  margin: 0.65rem 0 0.95rem;
  color: var(--muted);
}

.auth-assist {
  margin-top: 0.55rem;
  border: 1px solid rgba(127, 114, 93, 0.5);
  background: #d7c6b1;
  border-radius: 12px;
  padding: 0.8rem;
}

.auth-assist p {
  margin: 0 0 0.65rem;
  color: #5a5147;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.icon-btn {
  border: 1px solid rgba(129, 116, 95, 0.55);
  background: #d7c7b3;
  color: #4a4237;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: rgba(120, 137, 108, 0.7);
}

.account-email {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.account-block {
  border-top: 1px solid #c9b9a5;
  padding-top: 0.95rem;
  margin-top: 0.95rem;
}

.account-block h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.account-block-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.my-listing {
  border: 1px solid #c8b9a6;
  background: linear-gradient(180deg, #d3e0d1 0%, #d8c7b1 100%);
  border-radius: 12px;
  padding: 0.8rem;
}

.my-listing h5 {
  margin: 0;
  font-size: 0.98rem;
}

.my-listing-meta {
  margin: 0.42rem 0 0.5rem;
  color: #7b705f;
  font-size: 0.84rem;
}

.my-listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.btn.ghost {
  border-color: rgba(127, 114, 93, 0.52);
  color: #423a31;
  background: linear-gradient(140deg, #d8c3a8 0%, #cbb293 100%);
}

.btn.danger {
  border-color: rgba(187, 74, 70, 0.45);
  color: #fff0ef;
  background: linear-gradient(140deg, var(--danger) 0%, var(--danger-strong) 100%);
}

.danger-block p {
  margin-top: 0.35rem;
  margin-bottom: 0.9rem;
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .auth-state {
    width: 100%;
    justify-content: space-between;
  }

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

  .ads-header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-head,
  .account-block-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .toast,
  .btn {
    animation: none;
    transition: none;
  }
}
