@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg-top: #fdf7ef;
  --bg-bottom: #f7ebe1;
  --card: #fffdf9;
  --surface: #fffaf4;
  --text: #1d2330;
  --muted: #5f6675;
  --border: #e7d9cb;
  --primary: #d85f2d;
  --primary-dark: #b64a1f;
  --error: #b73232;
  --shadow: 0 24px 60px rgba(95, 66, 47, 0.16);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: #1f2850 url("../img/ENLOCKED.jpg") center 20% / cover no-repeat fixed;
  min-height: 100vh;
  line-height: 1.45;
  padding-top: 0;
}

.page {
  width: min(960px, 92vw);
  margin: 2.5rem auto 3.25rem;
}

.top-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  background: transparent; /* no background initially */
  padding: 2rem 1rem;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.4s ease;
}

.top-menu.scrolled {
  background: #e6ecf8;
  padding: 1.2rem 1rem;
}

.logo img {
  height: 70px;
  width: 70px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5rem;
  margin: 0;
  padding: 0;
}

.nav-menu ul li {
  display: flex;
  align-items: center;
}

.nav-menu ul li a {
  display: flex;
  align-items: center;
  line-height: 1;
  color: #1f2850;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.nav-menu ul li a:hover,
.nav-menu ul li a:focus-visible {
  color: #8a8a8a;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.social-icons a {
  display: flex;
  align-items: center;
}

.social-icons svg {
  width: 28px;
  height: 28px;
}

.social-icons svg {
  fill: #1f2850;
  transition: fill 0.3s ease;
}

.social-icons a:hover svg {
  fill: #8a8a8a;
}

.menu-toggle {
  display: none;
  font-size: 2rem;
  color: #1f2850;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.card {
  background: linear-gradient(180deg, #fffefb 0%, var(--card) 100%);
  border: 1px solid rgba(231, 217, 203, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2vw, 2rem);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -100px auto auto -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 195, 154, 0.35), transparent 72%);
  pointer-events: none;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

p {
  margin: 0.55rem 0 1.4rem;
  color: var(--muted);
  max-width: 62ch;
}

form {
  display: grid;
  gap: 1rem;
}

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

.form-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

fieldset {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0;
  display: grid;
  gap: 0.68rem;
}

legend {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 0.4rem;
}

label {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
}

.payment-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.address-autocomplete {
  position: relative;
}

.address-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid #dac8b9;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(26, 34, 52, 0.12);
}

.address-suggestions.is-open {
  display: block;
}

.address-suggestion {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #efe3d7;
  background: #ffffff;
  color: #2a3142;
  padding: 0.62rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.address-suggestion:last-child {
  border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus-visible {
  background: #f6efe7;
}

.price-breakdown {
  margin: 0.2rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed #d8c7b8;
  border-radius: 10px;
  background: #fffdf9;
}

.price-breakdown p {
  margin: 0.15rem 0;
  color: #394052;
  font-size: 0.92rem;
}

.price-breakdown p:last-child {
  margin-top: 0.45rem;
  font-weight: 800;
  color: #1d2330;
}

.payment-options {
  display: grid;
  gap: 0.55rem;
}

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

.payment-element {
  width: 100%;
  min-height: 52px;
  padding: 0.5rem 0;
}

.payment-charge-summary {
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #d8c7b8;
  display: grid;
  gap: 0.4rem;
}

.payment-charge-summary p {
  margin: 0;
  font-size: 0.93rem;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

.payment-charge-summary .line-price {
  background: #eef3ff;
  color: #21478c;
}

.payment-charge-summary .line-surcharge {
  background: #fff4de;
  color: #7a5700;
}

.payment-charge-summary .line-total {
  background: #e8f8ee;
  color: #16693a;
  font-weight: 800;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-start;
  margin: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid #dac8b9;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  width: 100%;
}

.payment-option input[type="radio"] {
  appearance: auto;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.payment-option.is-selected {
  border-color: #7b7b7b;
  background: #f4f4f4;
}

.provider-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.provider-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.provider-logo--stripe {
  background: #635bff;
}

.provider-logo--paypal {
  background: #003087;
}

.provider-logo--windcave {
  background: #00a3ad;
}

.provider-logo--poli {
  background: #ff7a00;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dac8b9;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 0.72rem 0.82rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 177, 141, 0.45);
}

input:invalid:focus,
select:invalid:focus,
textarea:invalid:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(183, 50, 50, 0.2);
}

input[readonly] {
  background: #ececec;
  color: #555a66;
  cursor: not-allowed;
  pointer-events: none;
}

input:disabled {
  background: #ececec;
  color: #555a66;
  cursor: not-allowed;
  pointer-events: none;
}

.form-status {
  margin: 0;
  min-height: 1.2em;
  font-weight: 600;
  color: var(--muted);
}

.form-status.is-success {
  color: #1f7f47;
}

.form-status.is-error {
  color: #b73232;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-right: 0.55rem;
  accent-color: var(--primary);
  vertical-align: text-bottom;
}

.agreements label {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--muted);
}

button[type="submit"] {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: #8a8a8a;
  cursor: pointer;
  justify-self: start;
  min-width: 180px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(0);
  background: #7b7b7b;
}

button[type="submit"]:focus-visible {
  outline: 3px solid rgba(255, 177, 141, 0.75);
  outline-offset: 2px;
}

.payment-footer-links {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.back-home-link {
  color: #1f2850;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  transition: color 160ms ease;
}

.back-home-link:hover,
.back-home-link:focus-visible {
  color: #8a8a8a;
}

@media (min-width: 760px) {
  .form-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
    align-items: start;
  }

  fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.75rem;
    align-items: start;
  }

  legend,
  .agreements label {
    grid-column: 1 / -1;
  }

  fieldset > label,
  fieldset > input,
  fieldset > select,
  fieldset > textarea {
    align-self: center;
  }

  fieldset > textarea,
  fieldset > input#address,
  fieldset > .payment-note {
    grid-column: 1 / -1;
  }

  .card-payment-fieldset {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-payment-fieldset > #payment-element,
  .card-payment-fieldset > .payment-charge-summary {
    grid-column: 1 / -1;
  }

  .form-column:last-child .form-status,
  .form-column:last-child button[type="submit"] {
    justify-self: end;
  }
}

@media (max-width: 759px) {
  .card {
    padding: 1rem;
  }

  button[type="submit"] {
    width: 100%;
    justify-self: stretch;
  }

  .payment-footer-links {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1024px) {
  .top-menu {
    flex-wrap: wrap;
    align-items: center;
  }

  .menu-toggle {
    display: block;
    order: 2;
  }

  .social-icons {
    order: 3;
    margin-left: auto;
  }

  .nav-menu {
    display: none;
    order: 4;
    width: 100%;
    padding: 1rem 0;
    background: rgba(0, 0, 0, 0.86);
    border-radius: 12px;
    text-align: center;
  }

  .nav-menu.active {
    display: block;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 1.3rem;
    align-items: center;
  }

  .nav-menu ul li a {
    color: #ffffff;
    font-size: 1.05rem;
  }

  .menu-toggle {
    color: #1f2850;
  }
}

.admin-page {
  width: min(1200px, 94vw);
}

.admin-card {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.admin-form {
  max-width: 420px;
}

.admin-text-link {
  font-weight: 700;
  color: #1d5fd1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-text-link:hover,
.admin-text-link:focus-visible {
  color: #1648a0;
}

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

.admin-logout {
  text-decoration: none;
  color: #ffffff;
  background: #8a8a8a;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
}

.admin-filter {
  display: flex;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.admin-filter label {
  margin-bottom: 0.25rem;
}

.admin-filter select {
  width: 220px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fffefb;
  border: 1px solid #dfcfbe;
  border-radius: 10px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.9rem 0.95rem;
  border-right: 1px solid #eadfd2;
  border-bottom: 1px solid #eadfd2;
  font-size: 0.95rem;
  line-height: 1.5;
}

.admin-table th {
  background: #f5ede4;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

.admin-table th:last-child,
.admin-table td:last-child {
  border-right: 0;
}

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

.admin-pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
}

.admin-pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.admin-pagination-summary span {
  color: var(--text);
}

.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-page-link,
.admin-page-indicator {
  min-width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #dfcfbe;
  background: #fffefb;
  font-weight: 700;
}

.admin-page-link {
  text-decoration: none;
  color: #1f2850;
}

.admin-page-link:hover,
.admin-page-link:focus-visible {
  background: #f5ede4;
}

.admin-page-link.is-disabled {
  color: #b7ab9e;
  background: #f7f1eb;
}

.admin-page-indicator {
  color: var(--text);
  background: #f5ede4;
}

.status-badge {
  display: inline-block;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  text-transform: lowercase;
}

.status-badge.status-paid {
  background: #e8f8ee;
  color: #16693a;
  border-color: #9ed7b0;
}

.status-badge.status-pending {
  background: #fff4de;
  color: #855b00;
  border-color: #f3d188;
}

.status-badge.status-failed {
  background: #fde8e8;
  color: #8d2626;
  border-color: #f0b1b1;
}

.status-badge.status-init_stripe,
.status-badge.status-init_paypal,
.status-badge.status-init_windcave,
.status-badge.status-init_poli {
  background: #e8f0ff;
  color: #244d95;
  border-color: #b3c7ef;
}

.status-badge.status-unknown {
  background: #f1f1f1;
  color: #4f4f4f;
  border-color: #d6d6d6;
}

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

  .admin-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-filter select {
    width: 100%;
  }

  .admin-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-pagination-controls {
    justify-content: flex-end;
  }
}
