:root {
  --page-bg: #f7f7fb;
  --panel-bg: #ffffff;
  --text: #252533;
  --muted: #585768;
  --placeholder: #686777;
  --line: #ddddE7;
  --line-focus: #7b5cff;
  --primary: #6847f5;
  --primary-dark: #5a3fe0;
  --danger: #d83b4a;
  --success: #23875c;
  --warning: #946400;
  --shadow: 0 18px 55px rgba(34, 34, 52, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 22% 34%, rgba(121, 96, 242, 0.08), transparent 16rem),
    linear-gradient(180deg, #fafaff 0%, var(--page-bg) 100%);
}

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 54px 28px;
  place-items: center;
}

.payment-layout {
  display: grid;
  width: min(1040px, 100%);
  grid-template-columns: 430px 580px;
  align-items: center;
  gap: 0;
}

.illustration-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  align-items: center;
  margin-right: -52px;
}

.illustration-panel img {
  display: block;
  width: min(430px, 100%);
  height: auto;
}

.payment-form {
  position: relative;
  z-index: 2;
  width: 580px;
  padding: 35px 40px 24px;
  border-radius: 20px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.form-header {
  margin-bottom: 20px;
}

.missing-reservation-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.35;
}

.missing-reservation-alert::before {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 999px;
  background: #ef4444;
}

h1 {
  max-width: 440px;
  margin: 0 0 13px;
  color: #282839;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.form-header p {
  max-width: 438px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.42;
  letter-spacing: -0.018em;
}

.form-header strong {
  color: var(--text);
  font-weight: 900;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.field {
  position: relative;
  display: block;
}

.input {
  width: 100%;
  height: 53px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input::placeholder {
  color: var(--placeholder);
  opacity: 0.92;
}

.input:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 4px rgba(104, 71, 245, 0.11);
}

.input.has-error {
  border-color: var(--danger);
}

.inline-fields {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 14px;
}

.expiry-field .input {
  padding-right: 100px;
}

.date-mask {
  position: absolute;
  right: 18px;
  top: 16px;
  color: var(--placeholder);
  font-size: 1.02rem;
  font-weight: 750;
  pointer-events: none;
}

.expiry-field .input:not(:placeholder-shown) + .date-mask,
.expiry-field .input:focus + .date-mask {
  display: none;
}

.cvc-field .input {
  padding-right: 82px;
}

.card-dots {
  position: absolute;
  right: 18px;
  top: 17px;
  display: inline-flex;
  align-items: center;
}

.card-dots i {
  width: 18px;
  height: 18px;
  margin-left: -4px;
  border-radius: 999px;
}

.card-dots i:nth-child(1) {
  background: #5960bd;
}

.card-dots i:nth-child(2) {
  background: #e04759;
}

.card-dots i:nth-child(3) {
  background: #f5a42d;
}

.error {
  display: block;
  min-height: 0;
  padding: 0 4px;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.error:empty {
  display: none;
}

.email-field[hidden] {
  display: none;
}

.notice {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(35, 135, 92, 0.1);
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.notice.warning {
  background: rgba(148, 100, 0, 0.1);
  color: var(--warning);
}

.notice.error {
  background: rgba(216, 59, 74, 0.1);
  color: var(--danger);
}

.submit-button {
  display: inline-flex;
  width: 100%;
  height: 51px;
  align-items: center;
  justify-content: center;
  margin-top: .75rem;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 20px rgba(104, 71, 245, 0.28);
  transition: filter 150ms ease, transform 150ms ease;
}

.submit-button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.72;
  transform: none;
}

.loader {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: white;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.is-loading .loader {
  display: inline-block;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 28px;
  margin-top: 13px;
}

.card-footer strong {
  color: #24406d;
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.mastercard-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
}

.mastercard-mark i {
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 999px;
}

.mastercard-mark i:first-child {
  left: 2px;
  background: #db3b3a;
}

.mastercard-mark i:last-child {
  right: 2px;
  background: #f4a51d;
  mix-blend-mode: multiply;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .payment-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
  }

  .illustration-panel {
    margin-right: 0;
  }

  .illustration-panel img {
    width: min(360px, 86vw);
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 24px 16px;
  }

  .payment-form {
    width: min(580px, 100%);
    padding: 26px 20px 20px;
  }

  .inline-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

}
