:root {
  --bg: #fff8e8;
  --panel: #ffffff;
  --primary: #d94c2f;
  --secondary: #3b7a22;
  --accent: #f2b84b;
  --text: #4b2e17;
  --muted: #7a5a3b;
  --border: #f0d7af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg), #ffe6b3);
  line-height: 1.6;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(242, 184, 75, 0.75) 0 4px, transparent 5px),
    radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.4) 0 3px, transparent 4px),
    linear-gradient(135deg, #7f2819, #d94c2f 52%, #9b321f);
  background-size: 42px 42px, 58px 58px, auto;
  padding: 6rem 1.5rem;
  color: #fff;
  text-align: center;
}

.hero--small {
  padding: 3.5rem 1.5rem;
}

.hero__content {
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.3rem 0 1rem;
}

.hero__text {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  margin-right: 0.5rem;
  font-weight: 600;
}

.btn--secondary {
  background: var(--accent);
  color: #4b2e17;
  font-weight: 600;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #155eaa;
  outline-offset: 3px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 980px;
  margin: -1.4rem auto 0;
  padding: 0 1rem;
}

.summary__item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.summary__item span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary__item strong {
  font-size: 1.1rem;
}

.section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.section__header {
  margin-bottom: 1rem;
}

.section__header h2 {
  margin: 0.3rem 0 0;
  font-size: 1.7rem;
}

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

.public-tabs {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.public-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  background: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.public-tab strong {
  min-width: 1.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  color: #101820;
  background: var(--accent);
  font-size: 0.8rem;
}

.public-tab.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.public-tab.is-active strong {
  color: var(--primary);
  background: #fff;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.2rem;
  margin-bottom: 0.65rem;
}

.card__description,
.item-description {
  color: var(--muted);
}

.card h3 {
  margin-top: 0;
  color: var(--secondary);
  display: -webkit-box;
  min-height: 3.2rem;
  margin-bottom: 0.55rem;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card__description {
  display: -webkit-box;
  min-height: 4.8rem;
  margin: 0 0 0.8rem;
  overflow: hidden;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card__price {
  margin-top: auto;
}

.card .btn-bid {
  margin-top: 0.2rem;
}

.card__price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.3rem 0;
  font-weight: 600;
}

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem;
  border-radius: 12px;
  background: #fff8e8;
  color: var(--muted);
}

.card__meta span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card__meta strong {
  color: var(--secondary);
  font-size: 0.95rem;
}

.countdown-chip {
  align-self: flex-start;
  margin-top: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #101820;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-countdown {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--brand-red);
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.card__qr {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem 0;
}

.card__qr img {
  width: 140px;
  height: 140px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.btn-bid {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.btn-bid:hover {
  background: #2e6119;
}

.btn-bid--muted {
  color: var(--text);
  background: #f2e2bf;
}

.status {
  display: inline-block;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.section--alt {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  padding: 1.4rem;
}

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

.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.item-page {
  max-width: 780px;
  margin: 3rem auto;
  padding: 0 1rem 2rem;
}

.item-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(97, 195, 217, 0.3), transparent 27%),
    radial-gradient(circle at 88% 78%, rgba(252, 213, 35, 0.18), transparent 24%),
    linear-gradient(145deg, #0e315f, #184287 62%, #2057a9);
}

.item-screen .brand-strip {
  box-shadow: 0 10px 28px rgba(5, 23, 52, 0.28);
}

.item-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.item-screen .item-card {
  border: 0;
  box-shadow: 0 22px 55px rgba(5, 23, 52, 0.34);
}

.item-card h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.item-card p {
  margin-top: 0;
}

.item-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #fff9e8;
  border-radius: 16px;
}

.item-price strong {
  font-size: 1.4rem;
}

.item-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.item-pill {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.item-pill--waiting {
  color: var(--text);
  background: var(--accent);
}

.item-pill--finished {
  background: #66584c;
}

.item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.item-heading h1 {
  margin: 0;
}

.info-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.info-box > div {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid var(--border);
}

.info-box p {
  margin: 0;
  color: var(--secondary);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.bid-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.item-screen .bid-form {
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 2px solid rgba(24, 66, 135, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(97, 195, 217, 0.16), rgba(255, 255, 255, 0.9)),
    #eef6fb;
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(24, 66, 135, 0.1);
}

.bid-form input,
.bid-form select,
.bid-form button {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  font: inherit;
}

.item-screen .bid-form input,
.item-screen .bid-form select {
  border: 2px solid #b8ccdc;
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 66, 135, 0.06);
}

.item-screen .bid-form input:focus,
.item-screen .bid-form select:focus {
  border-color: var(--primary);
}

.installment-preview {
  display: block;
  margin: 0.4rem 0 0 0.25rem;
  color: var(--primary);
  font-weight: 700;
}

.history-installments {
  min-width: 115px;
  color: var(--primary) !important;
  font-weight: 700;
}

.item-screen .bid-form button {
  margin-top: 0.25rem;
  min-height: 50px;
  box-shadow: 0 8px 18px rgba(24, 66, 135, 0.2);
}

.quick-bids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.item-screen .bid-form .quick-bid {
  min-height: 42px;
  margin: 0;
  border: 1px solid #9bb9cf;
  color: var(--primary);
  background: #fff;
  box-shadow: none;
  font-size: 0.88rem;
}

.item-screen .bid-form .quick-bid:hover {
  color: #fff;
  background: var(--primary);
}

.bid-form .field {
  text-align: left;
}

.bid-form button {
  background: var(--primary);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

.bid-form button:hover {
  background: #bd3f23;
}

.qr-box {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.qr-box img {
  width: 180px;
  height: 180px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin-top: 0;
}

.admin-page {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}

.dashboard {
  margin-bottom: 1.5rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(24, 66, 135, 0.1);
}

.dashboard__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard__heading h2 {
  margin: 0.45rem 0 0;
  font-size: 1.35rem;
}

.dashboard__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.dashboard-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fbfd;
}

.dashboard-card > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-card > strong {
  display: block;
  color: var(--primary);
  font-size: 1.35rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-card--primary {
  color: #fff;
  border-color: var(--primary);
  background: linear-gradient(135deg, #0e315f, var(--primary));
}

.dashboard-card--primary > span,
.dashboard-card--primary > strong {
  color: #fff;
}

.dashboard-card--wide,
.dashboard-card--upcoming {
  grid-column: span 2;
}

.dashboard-card--wide > strong {
  font-size: 1rem;
}

.dashboard-upcoming {
  display: grid;
  gap: 0.4rem;
}

.dashboard-upcoming__item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.4rem;
  color: var(--primary);
  text-decoration: none;
}

.dashboard-upcoming__item small {
  flex: 0 0 auto;
  color: var(--muted);
}

.admin-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.admin-tabs {
  margin-bottom: 1rem;
}

.admin-toolbar {
  display: flex;
  margin-bottom: 1rem;
}

.search-field {
  width: min(100%, 480px);
}

.search-field input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.admin-tab-btn {
  border: 1px solid var(--border);
  background: #fffdf8;
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.admin-tab-btn strong {
  background: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
}

.admin-tab-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-tab-btn.is-active strong {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.admin-list {
  display: grid;
  gap: 1rem;
}

.admin-links {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.admin-group {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
}

.admin-group__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.admin-group__header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--secondary);
}

.admin-group__header span {
  background: var(--accent);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.admin-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.admin-card__header h3 {
  margin: 0 0 0.3rem;
  color: var(--secondary);
}

.admin-card__header p {
  margin: 0;
  color: var(--muted);
}

.admin-card__info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.admin-actions {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.btn-admin {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-admin--primary {
  background: var(--secondary);
  color: #fff;
}

.btn-admin--danger {
  background: var(--primary);
  color: #fff;
}

.btn-admin--secondary {
  background: #f2e2bf;
  color: var(--text);
}

.btn-admin--result {
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
}

.btn-admin--result:hover {
  background: #0e315f;
}

.history-list {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.history-heading {
  display: grid;
  gap: 0.2rem;
}

.history-list h4 {
  margin: 0;
  color: var(--text);
}

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

.history-toggle,
.history-more,
.history-collapse {
  border: 1px solid rgba(18, 71, 135, 0.25);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  color: var(--primary);
  background: #f2f7fc;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.history-toggle:hover,
.history-more:hover {
  color: #fff;
  background: var(--primary);
}

.history-content {
  margin-top: 0.65rem;
}

.history-content[hidden],
.history-more[hidden] {
  display: none;
}

.history-controls {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding-top: 0.8rem;
}

.history-collapse {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.history-collapse:hover {
  color: var(--primary);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f7ebd1;
}

.history-item span {
  font-weight: 600;
}

.history-identity {
  display: grid;
  min-width: 145px;
}

.history-remove {
  border: 1px solid rgba(185, 50, 35, 0.3);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: #9f2d20;
  background: #fff5f3;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
}

.history-remove:hover {
  color: #fff;
  background: #9f2d20;
}

.history-remove:disabled {
  opacity: 0.55;
  cursor: wait;
}

.history-item small {
  color: var(--muted);
  font-size: 0.75rem;
}

.create-form {
  display: grid;
  gap: 1rem;
}

.btn-admin--ghost {
  color: #9f1f2f;
  background: #fff;
  border: 1px solid #ffc5c7;
}

.edit-item-form {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f5f9fc;
}

.edit-item-form h4 {
  margin: 0 0 0.8rem;
}

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

.login-card {
  width: min(100%, 480px);
  margin: 3rem auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(75, 46, 23, 0.12);
}

.login-card h2 {
  margin: 0.7rem 0 1.2rem;
}

[hidden] {
  display: none !important;
}

.field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font: inherit;
  background: #fffdf8;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.status--success {
  color: var(--secondary);
}

.status--error {
  color: var(--primary);
}

.winner-page {
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff8e8, #ffe3a7);
}

.winner-card {
  width: min(100%, 680px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.winner-content {
  text-align: center;
}

.winner-content h1 {
  margin: 0.3rem 0 0.5rem;
  color: var(--secondary);
  font-size: 2.2rem;
}

.winner-label {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.winner-content h2 {
  margin: 0.3rem 0 1rem;
  font-size: 1.8rem;
  color: var(--primary);
}

.winner-price,
.winner-meta {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  background: #fff4d6;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.winner-meta {
  flex-direction: column;
  align-items: flex-start;
  border-radius: 16px;
  gap: 0.2rem;
  margin-top: 0.4rem;
}

.winner-meta span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.winner-actions {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.winner-page::before,
.winner-page::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, gold 2px, transparent 2px);
  background-size: 18px 18px;
  opacity: 0.35;
  animation: confetti 4s linear infinite;
}

.winner-page::after {
  animation-duration: 5.5s;
  opacity: 0.2;
  transform: rotate(20deg);
}

@keyframes confetti {
  from { transform: translateY(-8%); }
  to { transform: translateY(8%); }
}

.footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
}

.site-footer {
  position: relative;
  z-index: 3;
  padding: 1.25rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
  background: var(--primary);
  box-shadow: 0 -8px 24px rgba(5, 23, 52, 0.12);
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.site-footer small {
  display: block;
  margin-top: 0.3rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
}

.site-footer--internal {
  background: var(--secondary);
}

@media (max-width: 760px) {
  .summary,
  .cards,
  .steps,
  .info-box {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .hero__actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .btn--primary {
    margin-right: 0;
  }

  .item-price {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-heading {
    flex-direction: column;
  }

  .admin-card__header,
  .admin-card__info,
  .admin-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-header {
    align-items: flex-start;
  }

  .history-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .history-toggle {
    flex: 0 0 auto;
  }

  .history-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    padding: 0.75rem 0;
  }

  .history-identity {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-width: 0;
  }

  .history-item > strong {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .history-item > .history-installments {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }

  .history-item > small:not(.history-installments) {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
  }

  .history-remove {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }

  .history-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions-bar {
    justify-content: flex-start;
  }

  .dashboard__heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .dashboard-card--wide,
  .dashboard-card--upcoming {
    grid-column: auto;
  }

  .dashboard-upcoming__item {
    flex-direction: column;
    gap: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Identidade Auto Viação Dragão do Mar — Manual de Marca */
@font-face {
  font-family: 'Raleway Brand';
  src: url('assets/Raleway-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --primary: #184287;
  --secondary: #184287;
  --accent: #fcd523;
  --brand-red: #ff4e50;
  --brand-sky: #61c3d9;
  --text: #101820;
  --muted: #526171;
  --border: #d6e2ec;
}

body {
  font-family: 'Raleway Brand', Raleway, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(97, 195, 217, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbfd, var(--bg));
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 8px solid var(--accent);
  background:
    radial-gradient(circle at 82% 14%, rgba(97, 195, 217, 0.24), transparent 24%),
    linear-gradient(135deg, #0e315f, #184287 58%, #2057a9);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.hero::before {
  width: 54rem;
  height: 12rem;
  right: -12rem;
  bottom: -10.5rem;
  border: 8px solid var(--brand-sky);
  transform: rotate(-4deg);
}

.hero::after {
  width: 48rem;
  height: 11rem;
  left: -14rem;
  bottom: -10.2rem;
  border: 7px solid var(--brand-red);
  transform: rotate(5deg);
}

.hero__content {
  position: relative;
  z-index: 1;
}

.brand-signature {
  display: flex;
  width: min(290px, 72vw);
  margin: 0 auto 1.5rem;
  padding: 0.8rem 1.15rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(6, 25, 55, 0.24);
}

.brand-signature img,
.brand-strip img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-strip {
  display: block;
  width: min(260px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: #fff;
}

.hero h1,
.section__header h2,
.card h3,
.admin-card h3,
.winner-content h1 {
  font-weight: 800;
  letter-spacing: -0.025em;
}

.eyebrow {
  color: #101820;
  background: var(--accent);
  letter-spacing: 0.14em;
}

.btn--secondary {
  color: #101820;
}

.btn-bid:hover,
.bid-form button:hover {
  background: #0e315f;
}

.summary__item {
  border-top: 4px solid var(--brand-sky);
  box-shadow: 0 10px 28px rgba(24, 66, 135, 0.1);
}

.card,
.admin-card,
.item-card {
  box-shadow: 0 12px 30px rgba(24, 66, 135, 0.08);
}

.card__meta {
  background: #eef7fa;
}

.status {
  color: var(--brand-red);
}

.section--alt {
  border-top: 5px solid var(--accent);
  background: rgba(255, 255, 255, 0.78);
}

.item-price {
  background: #edf5fb;
}

.item-pill--finished {
  background: #101820;
}

.info-box > div,
.admin-tab-btn,
.field input,
.field textarea {
  background: #f9fbfd;
}

.admin-group {
  background: rgba(255, 255, 255, 0.82);
}

.btn-admin--danger {
  background: var(--brand-red);
}

.status--success {
  color: var(--primary);
}

.status--error {
  color: #c82132;
}

.winner-page {
  background:
    radial-gradient(circle at 50% 15%, rgba(252, 213, 35, 0.24), transparent 24%),
    linear-gradient(135deg, #f4f8fc, #e4f3f7);
}

.winner-price,
.winner-meta {
  background: #fff8ca;
}

.winner-page::before,
.winner-page::after {
  background-image: radial-gradient(circle, var(--accent) 2px, transparent 2px);
}

body {
  overflow-x: hidden;
}

.hero__content {
  width: 100%;
}

.hero h1 {
  overflow-wrap: anywhere;
}

.hero .btn--primary {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 8px 22px rgba(6, 25, 55, 0.24);
}

.hero .btn--primary:hover {
  color: #fff;
  background: #0e315f;
}

.hero .btn--secondary {
  color: #101820;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(6, 25, 55, 0.2);
}

.hero .btn--secondary:hover {
  background: #ffe35a;
}

.summary {
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
}

.summary__item {
  min-width: 0;
  overflow: visible;
}

.summary__item strong {
  display: block;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .hero {
    padding-inline: 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.15;
  }

  .brand-signature {
    width: min(250px, 78vw);
  }

  .summary {
    width: 100%;
    margin-top: 1rem;
    padding-inline: 1rem;
    gap: 0.75rem;
  }

  .summary__item {
    width: 100%;
    padding: 1rem 0.8rem;
  }
}

.card__image,
.card__image-placeholder {
  width: calc(100% + 2.4rem);
  height: 220px;
  margin: -1.2rem -1.2rem 1rem;
  border-radius: 20px 20px 0 0;
  object-fit: cover;
}

.card__image-placeholder {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(97, 195, 217, 0.26), rgba(24, 66, 135, 0.12)),
    #edf5fb;
}

.card__image-placeholder::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 80%;
  right: -18%;
  bottom: -55%;
  border: 12px solid var(--accent);
  border-radius: 50%;
}

.item-hero-image {
  display: block;
  width: 100%;
  max-height: 420px;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  object-fit: cover;
}

.carousel {
  margin-bottom: 1.25rem;
}

.carousel__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  background: #e8f1f7;
  touch-action: pan-y;
}

.carousel__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__control {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(14, 49, 95, 0.84);
  font: 700 2rem/1 'Raleway Brand', sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel__control--previous {
  left: 0.75rem;
}

.carousel__control--next {
  right: 0.75rem;
}

.carousel__counter {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(14, 49, 95, 0.84);
  font-size: 0.82rem;
  font-weight: 700;
}

.carousel__thumbs {
  display: flex;
  gap: 0.55rem;
  padding: 0.7rem 0.15rem 0.2rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.carousel__thumb {
  flex: 0 0 76px;
  height: 58px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.carousel__thumb.is-active {
  border-color: var(--primary);
}

.carousel__thumb img {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
}

.qr-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.qr-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.qr-section p {
  max-width: 440px;
  margin: 0.5rem auto 1rem;
  color: var(--muted);
}

.qr-image {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border: 10px solid #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(24, 66, 135, 0.13);
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #9f1f2f;
  font-weight: 650;
}

.check-field input {
  width: 1.1rem;
  height: 1.1rem;
}

.gallery-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.7rem;
}

.gallery-editor > p {
  grid-column: 1 / -1;
  margin: 0;
}

.gallery-editor__item {
  position: relative;
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}

.gallery-editor__item img {
  width: 100%;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
}

.gallery-editor__item input {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
}

@media (max-width: 480px) {
  .carousel__viewport {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .carousel__control {
    width: 40px;
    height: 40px;
  }
}

.admin-card__image {
  width: 112px;
  height: 82px;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  object-fit: cover;
}

.winner-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(97, 195, 217, 0.28), transparent 25%),
    radial-gradient(circle at 85% 75%, rgba(252, 213, 35, 0.2), transparent 24%),
    linear-gradient(145deg, #0b294f, #184287 58%, #2464b8);
}

.winner-screen .brand-strip {
  position: relative;
  z-index: 3;
  box-shadow: 0 10px 28px rgba(5, 23, 52, 0.3);
}

.winner-screen .winner-page {
  min-height: calc(100vh - 120px);
  background: transparent;
}

.winner-screen .winner-card {
  position: relative;
  overflow: hidden;
  border: 0;
  border-top: 8px solid var(--accent);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(4, 19, 44, 0.42);
}

.winner-screen .winner-card::before {
  content: '';
  position: absolute;
  width: 18rem;
  height: 8rem;
  right: -8rem;
  top: -5.5rem;
  border: 8px solid var(--brand-sky);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.winner-item-image {
  display: block;
  width: calc(100% + 4rem);
  max-height: 310px;
  margin: -2rem -2rem 1.5rem;
  object-fit: cover;
}

.winner-celebration {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #101820;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(252, 213, 35, 0.36);
  font-size: 2.2rem;
  animation: winner-pop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.winner-item-image + .winner-celebration {
  margin-top: -3.75rem;
  position: relative;
}

.winner-item-name {
  margin: 1rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.winner-screen .winner-content h1 {
  margin-top: 0.25rem;
  color: var(--primary);
}

.winner-screen .winner-content h2 {
  margin: 0.35rem 0 1.15rem;
  color: var(--brand-red);
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1.05;
}

.winner-screen .winner-price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  width: min(100%, 390px);
  margin: 0 auto 1rem;
  border: 1px solid #f0d550;
  background: #fff8ca;
}

.winner-installments {
  flex-basis: 100%;
  color: var(--secondary);
  font-weight: 700;
}

.winner-screen .winner-price strong {
  color: var(--primary);
  font-size: 1.5rem;
}

.winner-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
  margin: 0 auto 1.25rem;
}

.winner-details > div {
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f5f9fc;
}

.winner-details strong {
  display: block;
  color: var(--primary);
}

.winner-screen .winner-actions {
  padding-top: 0.25rem;
}

.winner-screen .winner-page::before {
  background-image:
    radial-gradient(circle, var(--accent) 2px, transparent 3px),
    radial-gradient(circle, var(--brand-sky) 2px, transparent 3px);
  background-position: 0 0, 10px 12px;
}

.winner-screen .winner-page::after {
  background-image:
    radial-gradient(circle, var(--brand-red) 2px, transparent 3px),
    radial-gradient(circle, #fff 2px, transparent 3px);
  background-position: 0 0, 12px 8px;
}

@keyframes winner-pop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-18deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 560px) {
  .winner-screen .winner-page {
    padding-inline: 0.75rem;
  }

  .winner-screen .winner-card {
    padding: 1.25rem;
    border-radius: 22px;
  }

  .winner-item-image {
    width: calc(100% + 2.5rem);
    margin: -1.25rem -1.25rem 1.5rem;
  }

  .winner-screen .winner-price {
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
  }
}
