:root {
  --red: #ed1824;
  --ink: #211d1e;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  font-family:
    "Yu Gothic",
    "Hiragino Kaku Gothic ProN",
    Meiryo,
    sans-serif;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.contact-page {
  min-height: 100vh;
  padding: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(237, 24, 36, 0.34), transparent 25%),
    repeating-linear-gradient(
      135deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.025) 19px 20px
    ),
    #121011;
}

.contact-window {
  width: min(100%, 700px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #3d3739;
  border-top: 6px solid var(--red);
  background:
    linear-gradient(rgba(244, 238, 226, 0.9), rgba(244, 238, 226, 0.94)),
    url("public/images/contact-background.jpg") center / cover no-repeat;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
}

.contact-window-header {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: stretch;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(237, 24, 36, 0.14), transparent 48%),
    var(--ink);
}

.contact-window-brand {
  display: grid;
  min-height: 104px;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 35px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.contact-window-header > div {
  padding: 18px 26px 16px;
}

.contact-window-header p {
  margin: 0 0 1px;
  color: var(--red);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 17px;
  letter-spacing: 0.18em;
}

.contact-window-header h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.contact-window-intro {
  padding: 22px 32px 0;
}

.contact-window-intro p {
  margin: 0;
  color: #514a4c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
}

.contact-form {
  display: grid;
  gap: 19px;
  padding: 23px 32px 25px;
}

.form-field,
.form-fieldset {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-label-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-label {
  color: #2b2527;
  font-size: 14px;
  font-weight: 900;
}

.form-label-note {
  margin-left: 8px;
  color: #746b6d;
  font-size: 10px;
  font-weight: 700;
}

.required-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.5;
}

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

.name-fields label {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #675e61;
  font-size: 12px;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid #b9adaf;
  border-radius: 0;
  color: var(--ink);
  background: #fffdfa;
  font: inherit;
  font-size: 16px;
  outline: 0;
}

.contact-form input {
  height: 43px;
  padding: 7px 10px;
}

.contact-form textarea {
  min-height: 150px;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(237, 24, 36, 0.14);
}

.phone-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.phone-fields input {
  text-align: center;
}

.field-hint,
.privacy-note {
  margin: 0;
  color: #746b6d;
  font-size: 11px;
  font-weight: 700;
}

.category-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.category-option {
  position: relative;
  cursor: pointer;
}

.category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.category-option span {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #a99ea0;
  color: #4b4345;
  background: #fffdfa;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.category-option span::before {
  display: grid;
  width: 10px;
  height: 10px;
  place-items: center;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-radius: 2px;
  content: "";
}

.category-option input:checked + span {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
  box-shadow: 0 5px 12px rgba(117, 0, 8, 0.2);
}

.category-option input:checked + span::before {
  color: var(--red);
  background: #fff;
  content: "✓";
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.category-option input:focus-visible + span {
  outline: 3px solid #211d1e;
  outline-offset: 2px;
}

.message-composer {
  display: grid;
}

.message-category-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid #b9adaf;
  border-bottom: 0;
  color: #766d6f;
  background: #e6ded2;
  font-size: 11px;
  font-weight: 800;
}

.message-category-header strong {
  color: #5f5658;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.message-category-header.is-selected strong {
  color: var(--red);
}

.message-composer textarea {
  border-top-color: #d8ced0;
}

.privacy-consent {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  color: #3b3436;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.privacy-consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--red);
}

.privacy-consent input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.privacy-consent-help {
  margin: -6px 0 0;
  color: #6f6668;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.privacy-consent a {
  color: #a9000c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-consent a:hover,
.privacy-consent a:focus-visible {
  color: #ed1824;
}

.privacy-note {
  padding: 10px 12px;
  border-left: 3px solid #989092;
  background: rgba(33, 29, 30, 0.055);
  line-height: 1.6;
}

.website-field {
  position: absolute;
  left: -9999px;
}

.turnstile-field {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
}

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

.captcha-note {
  margin: 0;
  color: #b0000c;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.form-submit {
  width: min(100%, 280px);
  min-height: 52px;
  margin: 0 auto;
  border: 2px solid var(--red);
  color: #fff;
  background: var(--red);
  box-shadow: 0 8px 18px rgba(117, 0, 8, 0.24);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.form-submit:hover,
.form-submit:focus-visible {
  color: var(--red);
  background: #fff;
}

.form-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-status {
  min-height: 1.7em;
  margin: -5px 0 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
}

.form-status-success {
  color: #236329;
}

.form-status-error {
  color: #b0000c;
}

.contact-window-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 14px 32px 18px;
  border-top: 1px solid #d5cacc;
}

.contact-window-footer a,
.contact-window-footer button {
  padding: 0;
  border: 0;
  color: #665d60;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .contact-page {
    padding: 10px;
  }

  .contact-window-header {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .contact-window-brand {
    min-height: 88px;
    font-size: 28px;
  }

  .contact-window-header > div {
    padding: 15px 18px 13px;
  }

  .contact-window-header h1 {
    font-size: 22px;
  }

  .contact-window-intro {
    padding: 18px 18px 0;
  }

  .contact-form {
    gap: 18px;
    padding: 20px 18px 22px;
  }

  .name-fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-options {
    gap: 7px;
  }
}
