@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
  --ink: #36271f;
  --muted: #7b6b62;
  --paper: #fffdf9;
  --cream: #fbf4eb;
  --line: #eadfd6;
  --pink: #efaaa3;
  --pink-dark: #a95358;
  --pink-soft: #fbedeb;
  --blue: #99c1cf;
  --blue-dark: #437384;
  --blue-soft: #eaf5f7;
  --caramel: #9a6a42;
  --green: #39735b;
  --shadow: 0 18px 55px rgba(74, 47, 34, .1);
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); font-family: "DM Sans", Arial, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.eyebrow { margin: 0; color: var(--pink-dark); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-pair { display: flex; align-items: center; justify-content: center; gap: 16px; }
.brand-pair img { width: 145px; height: 112px; object-fit: contain; mix-blend-mode: multiply; }
.brand-pair span { width: 1px; height: 58px; background: var(--line); }
.brand-pair.compact { gap: 9px; justify-content: flex-start; }
.brand-pair.compact img { width: 76px; height: 58px; }
.brand-pair.compact span { height: 32px; }

.home-page { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at 16% 12%, #f8ded9 0, transparent 28rem), radial-gradient(circle at 85% 88%, #dfeef2 0, transparent 28rem), var(--cream); }
.home-card { width: min(100%, 620px); padding: 52px 28px; border: 1px solid rgba(234, 223, 214, .8); border-radius: 34px; background: rgba(255, 253, 249, .9); text-align: center; box-shadow: var(--shadow); }
.home-card h1 { margin: 10px 0; font: 700 clamp(2.3rem, 8vw, 4rem)/1.05 "Playfair Display", serif; }
.home-card > p:last-child { max-width: 430px; margin: 18px auto 0; color: var(--muted); }

.proposal-page { min-height: 100vh; background: linear-gradient(180deg, #fff 0, #fff 47rem, var(--cream) 100%); }
.proposal-shell { width: min(100%, 560px); min-height: 100vh; margin: 0 auto; padding: 0 18px 34px; background: var(--paper); }
.proposal-header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.proposal-header > p { margin: 0; color: var(--muted); font-size: .68rem; font-weight: 600; line-height: 1.35; text-align: right; text-transform: uppercase; letter-spacing: .08em; }
.proposal-loading { min-height: 70vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--pink-dark); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proposal-state { min-height: 75vh; padding: 30px; display: grid; place-content: center; justify-items: center; text-align: center; }
.proposal-state img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; }
.proposal-state h1 { margin: 8px 0; font: 700 2.3rem "Playfair Display", serif; }
.proposal-state > p:last-child { margin: 0; color: var(--muted); }
.proposal-hero { padding: 42px 8px 28px; text-align: center; }
.proposal-hero h1 { max-width: 450px; margin: 10px auto 14px; font: 700 clamp(2.6rem, 11vw, 4rem)/.98 "Playfair Display", serif; letter-spacing: -.04em; }
.proposal-hero > p { max-width: 400px; margin: 0 auto; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.proposal-meta { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.proposal-meta span { padding: 7px 10px; border-radius: 999px; background: var(--cream); color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .04em; }
.proposal-meta span:last-child { background: var(--pink-soft); color: var(--pink-dark); }
.pieces-card { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: stretch; margin-bottom: 30px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 12px 34px rgba(70, 48, 37, .06); }
.pieces-card div { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pieces-card span { color: var(--muted); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pieces-card strong { font: 700 2rem "Playfair Display", serif; }
.pieces-card i { background: var(--line); }
.section-title { margin: 10px 0 14px; text-align: center; }
.section-title span { color: var(--pink-dark); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; }
.section-title h2 { margin: 4px 0; font: 700 1.8rem "Playfair Display", serif; }
.offer-grid { display: grid; gap: 12px; }
.offer-card { position: relative; overflow: hidden; padding: 22px; border-radius: 25px; container-type: inline-size; }
.cash-card { color: #fff; background: linear-gradient(145deg, #513b31, #30231d); }
.coin-card { border: 1px solid #bed7df; background: linear-gradient(145deg, #eff8fa, #fce7e3); }
.offer-icon { position: absolute; right: 20px; top: 18px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; color: #fff; font: 600 1.1rem "Playfair Display", serif; }
.coin-badge { position: absolute; right: 16px; top: 18px; padding: 7px 9px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--blue-dark); font-size: .58rem; font-weight: 700; letter-spacing: .08em; }
.offer-card small { display: block; margin-right: 98px; opacity: .72; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.offer-card strong { display: block; max-width: 100%; margin: 8px 0 5px; font: 700 clamp(2.4rem, 12vw, 3.6rem)/1 "Playfair Display", serif; font-variant-numeric: tabular-nums; letter-spacing: -.035em; white-space: nowrap; }
.coin-card strong { color: var(--blue-dark); }
.offer-card p { min-height: 36px; margin: 0 0 18px; opacity: .78; font-size: .72rem; line-height: 1.5; }
.offer-card button { width: 100%; min-height: 52px; border-radius: 14px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.cash-card button { border: 1px solid rgba(255,255,255,.65); background: #fff; color: var(--ink); }
.coin-card button { border: 0; background: var(--blue-dark); color: #fff; }
.offer-card button:disabled, .decline-button:disabled { cursor: default; opacity: .45; }
.factors-card { margin-top: 15px; padding: 25px 21px; border: 1px solid var(--line); border-radius: 25px; background: #fff; }
.factors-card h2 { margin: 5px 0 14px; font: 700 1.65rem "Playfair Display", serif; }
.factors-card ul { margin: 0; padding: 0; list-style: none; }
.factors-card li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.factors-card li:last-child { border: 0; }
.factors-card i { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--pink-soft); color: var(--pink-dark); font-style: normal; }
.decline-button { width: 100%; margin: 13px 0; padding: 17px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; text-decoration: underline; }
.decision-result { margin: 14px 0; padding: 21px; border-radius: 18px; background: #e4f1e9; color: var(--green); font-size: .8rem; font-weight: 700; text-align: center; }
.decision-result.rejected { background: var(--pink-soft); color: var(--pink-dark); }
.decision-result p { margin: 0; }
.result-whatsapp { min-height: 48px; margin-top: 15px; padding: 12px; display: grid; place-items: center; border-radius: 13px; background: #367a50; color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.terms-card { margin: 12px 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); }
.terms-card summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; font-size: .8rem; font-weight: 700; }
.terms-card summary::-webkit-details-marker { display: none; }
.terms-card summary b { font-size: 1.2rem; }
.terms-card[open] summary b { transform: rotate(45deg); }
.terms-card p { margin: 13px 0 2px; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.proposal-footer { padding: 27px 0 4px; display: grid; justify-items: center; }
.proposal-footer > p { max-width: 260px; color: var(--muted); font: 600 1.15rem "Playfair Display", serif; text-align: center; }
.secret-admin { width: 78px; height: 78px; overflow: hidden; display: block; border-radius: 50%; box-shadow: 0 7px 20px rgba(72,49,34,.12); transition: transform .2s; }
.secret-admin:hover { transform: rotate(-7deg) scale(1.04); }
.secret-admin img { width: 100%; height: 100%; object-fit: cover; }

.confirm-dialog { width: min(calc(100% - 28px), 420px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 25px 90px rgba(45,28,19,.28); }
.confirm-dialog::backdrop { background: rgba(46,33,27,.6); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: 27px; text-align: center; }
.confirm-dialog form > span { width: 48px; height: 48px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }
.confirm-dialog h2 { margin: 0; font: 700 1.65rem "Playfair Display", serif; }
.confirm-dialog p { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.confirm-dialog form > div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 20px; }
.confirm-dialog button { min-height: 48px; border-radius: 13px; font-weight: 700; }
.dialog-cancel { border: 1px solid var(--line); background: #fff; color: var(--muted); }
.dialog-confirm { border: 0; background: var(--ink); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: calc(100% - 28px); padding: 12px 17px; border-radius: 12px; background: var(--ink); color: #fff; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .2s; font-size: .75rem; text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-page { min-height: 100vh; background: radial-gradient(circle at 5% 5%, #f9dfda 0, transparent 30rem), radial-gradient(circle at 95% 95%, #dceef2 0, transparent 30rem), var(--cream); }
.admin-shell { width: min(100%, 900px); min-height: 100vh; margin: auto; }
.auth-card { width: min(calc(100% - 28px), 420px); margin: 7vh auto; padding: 32px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,253,249,.95); text-align: center; box-shadow: var(--shadow); }
.auth-card > img { width: 125px; height: 125px; border-radius: 50%; object-fit: cover; }
.auth-card h1 { margin: 7px 0; font: 700 2.3rem "Playfair Display", serif; }
.auth-card > p:not(.eyebrow) { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.auth-card form { margin-top: 22px; text-align: left; }
.auth-card small { display: block; margin-top: 14px; color: var(--muted); font-size: .65rem; }
.admin-header { min-height: 86px; padding: 10px 20px; display: flex; align-items: center; gap: 17px; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(234,223,214,.9); background: rgba(255,253,249,.92); backdrop-filter: blur(16px); }
.admin-header > div:nth-child(2) { flex: 1; }
.admin-header h1 { margin: 1px 0; font: 700 1.4rem "Playfair Display", serif; }
.logout-button { padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: .7rem; }
.admin-main { padding: 22px 16px 45px; }
.new-proposal-toggle { width: 100%; min-height: 60px; margin-bottom: 14px; border: 0; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 12px 30px rgba(54,39,31,.16); }
.new-proposal-toggle span { margin-right: 7px; font-size: 1.2rem; }
.proposal-form, .created-card { margin-bottom: 16px; padding: 21px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.form-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.form-heading h2, .created-card h2 { margin: 3px 0 0; font: 700 1.7rem "Playfair Display", serif; }
.form-notice { display: block; max-width: 520px; margin-top: 5px; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.form-heading button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 1.2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 11px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: .7rem; font-weight: 700; }
input { width: 100%; min-height: 49px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #fff; color: var(--ink); }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.primary-button { width: 100%; min-height: 53px; border: 0; border-radius: 14px; background: var(--pink-dark); color: #fff; font-size: .78rem; font-weight: 700; }
.primary-button:disabled { opacity: .55; }
.created-card { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; }
.success-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #e4f1e9; color: var(--green); }
.created-card > label, .created-actions { grid-column: 1 / -1; }
.copy-field { display: flex; }
.copy-field input { min-width: 0; border-radius: 12px 0 0 12px; font-size: .65rem; }
.copy-field button { border: 0; border-radius: 0 12px 12px 0; background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }
.created-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.created-actions a { min-height: 47px; display: grid; place-items: center; border-radius: 13px; font-size: .7rem; font-weight: 700; text-decoration: none; }
.whatsapp-button { background: #3f7e5c; color: #fff; }
.preview-button { border: 1px solid var(--line); background: #fff; color: var(--muted); }
.dashboard-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 5px 0 15px; }
.dashboard-summary article { padding: 14px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,249,.9); }
.dashboard-summary span { color: var(--muted); font-size: .6rem; }
.dashboard-summary strong { color: var(--ink); font: 700 1.65rem "Playfair Display", serif; }
.list-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; left: 13px; top: 12px; color: var(--muted); font-size: 1.1rem; }
.search-field input { padding-left: 38px; }
.export-button { padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: .68rem; font-weight: 700; }
.filter-tabs { display: flex; gap: 7px; margin: 13px 0; overflow-x: auto; scrollbar-width: none; }
.filter-tabs button { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .65rem; font-weight: 700; }
.filter-tabs button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.proposal-list { display: grid; gap: 10px; }
.proposal-row { padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 7px 24px rgba(70,48,37,.05); }
.proposal-row-top, .proposal-row-bottom, .proposal-row-actions { display: flex; align-items: center; gap: 10px; }
.proposal-row-top > div { min-width: 0; flex: 1; }
.proposal-row-top h3 { margin: 0; overflow: hidden; font: 700 1.15rem "Playfair Display", serif; text-overflow: ellipsis; white-space: nowrap; }
.proposal-row-top p { margin: 3px 0 0; color: var(--muted); font-size: .6rem; }
.status-pill { padding: 6px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .57rem; font-weight: 700; white-space: nowrap; }
.status-pill.accepted_cash, .status-pill.accepted_coin { background: #e4f1e9; color: var(--green); }
.status-pill.rejected { background: var(--pink-soft); color: var(--pink-dark); }
.status-pill.expired { background: #eeeae7; color: #756b65; }
.proposal-row-bottom { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.proposal-row-bottom span { color: var(--muted); font-size: .63rem; }
.proposal-row-bottom strong { margin-left: auto; color: var(--ink); font-size: .76rem; }
.proposal-row-actions { margin-top: 12px; }
.proposal-row-actions a, .proposal-row-actions button { flex: 1; min-height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: .63rem; font-weight: 700; text-decoration: none; }
.proposal-row-actions button { color: var(--blue-dark); }
.row-management { position: relative; margin-top: 9px; }
.row-management summary { min-height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--cream); color: var(--ink); cursor: pointer; font-size: .64rem; font-weight: 700; list-style: none; }
.row-management summary::-webkit-details-marker { display: none; }
.management-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.management-menu button { min-height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: .63rem; font-weight: 700; }
.management-menu button.archive { color: var(--caramel); }
.management-menu button.danger { border-color: #efcbca; background: #fff4f3; color: #a33f43; }
.empty-list { padding: 45px 20px; border: 1px dashed var(--line); border-radius: 20px; text-align: center; color: var(--muted); }
.empty-list img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }

@media (min-width: 620px) {
  .proposal-page { padding: 26px 0; }
  .proposal-shell { min-height: calc(100vh - 52px); border: 1px solid var(--line); border-radius: 32px; overflow: hidden; box-shadow: var(--shadow); }
  .offer-grid { grid-template-columns: 1fr 1fr; }
  .offer-card strong { font-size: 2.2rem; }
  .offer-card { display: flex; flex-direction: column; }
  .offer-card button { margin-top: auto; }
}

@supports (font-size: 1cqi) {
  .offer-card strong { font-size: clamp(1.8rem, 17cqi, 3.6rem); }
}

@media (max-width: 650px) {
  .admin-header .brand-pair { display: none; }
  .dashboard-summary { grid-template-columns: 1fr 1fr; }
  .admin-main { padding-inline: 12px; }
}

@media (max-width: 420px) {
  .proposal-header .brand-pair.compact img { width: 65px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .list-tools { grid-template-columns: 1fr; }
  .export-button { min-height: 43px; }
}
