:root {
  --page-bg: #333333;
  --frame-bg: #ffffff;
  --header-bg: #16c4cd;
  --header-text: #ffffff;
  --text-main: #2f3540;
  --text-soft: #5f6b77;
  --border-soft: #d9dde2;
  --border-strong: #b9bcc1;
  --card-shadow: 0 26px 48px rgba(24, 34, 44, 0.12);
  --field-shadow: 0 1px 2px rgba(23, 34, 45, 0.06);
  --accent-blue: #1578ff;
  --accent-red: #ea3a48;
  --accent-green: #53d124;
  --accent-navy: #111d96;
  --footer-bg: #2c2c2c;
  --footer-text: #fbfbfb;
  --radius-frame: 30px;
  --radius-card: 18px;
  --radius-field: 6px;
  --page-padding: clamp(0px, 1.5vw, 18px);
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-brand: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
}

button,
input,
select {
  font: inherit;
}

img,
svg {
  display: block;
}

.page-shell {
  min-height: calc(100vh - var(--page-padding) - var(--page-padding));
}

.page-frame {
  min-height: inherit;
  display: flex;
  flex-direction: column;
  background: var(--frame-bg);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 18px 0;
  background: var(--header-bg);
  color: var(--header-text);
}

.site-header__meta {
  padding: 10px 0 12px;
  text-align: right;
}

.site-url {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.06;
  text-decoration: none;
  color: white;
}

.site-session {
  margin: 8px 0 0;
  font-weight: 500;
  font-size: 20px;
}

.content-wrap {
  flex: 1;
  padding: 24px 18px 0;
  background:
    radial-gradient(
      circle at top center,
      rgba(30, 196, 205, 0.06),
      transparent 32%
    ),
    #ffffff;
}

.form-card {
  width: min(100%, 1125px);
  margin: 0 auto 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: var(--card-shadow);
}

.card-heading {
  padding: 26px 36px 22px;
  border-bottom: 1px solid #ececec;
  text-align: center;
}

.card-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 1vw, 3.05rem);
  line-height: 1.12;
}

.result-form {
  padding: 22px 38px 8px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.36fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.field-row--actions,
.field-row--status {
  margin-bottom: 0;
}

.field-row--status .field-label--spacer {
  font-size: 0;
  line-height: 0;
}

.field-label {
  padding-top: 12px;
  color: #272e36;
  font-size: clamp(1.02rem, 0.94rem + 0.34vw, 1.22rem);
  font-weight: 500;
  line-height: 1.4;
}

.field-label__note {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 14px;
}

.field-label--spacer {
  padding-top: 0;
}

.field {
  display: block;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-field);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--field-shadow);
  font-size: 1rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.date-picker {
  position: relative;
}

.date-picker input {
  cursor: pointer;
}

.date-picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(100%, 316px);
  min-width: 316px;
  padding: 4px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 28px rgba(26, 35, 45, 0.14);
}

.date-picker__panel[hidden] {
  display: none;
}

.date-picker__controls {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 22px;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #ededed;
}

.date-picker__nav {
  width: 18px;
  height: 18px;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4a4a4a;
  color: #ffffff;
  font-size: 0.58rem;
  cursor: pointer;
}

.date-picker__nav:hover {
  background: #363636;
}

.date-picker__nav:disabled {
  background: #b9b9b9;
  cursor: default;
}

.date-picker__select {
  width: 100%;
  height: 31px;
  padding: 0 8px;
  border: 1px solid #232323;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  font-size: 0.78rem;
  font-weight: 500;
}

.date-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-top: 8px;
  padding: 0 2px;
}

.date-picker__weekdays span {
  display: grid;
  place-items: center;
  min-height: 26px;
  color: #353535;
  font-size: 0.78rem;
  font-weight: 700;
}

.date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-top: 2px;
}

.date-picker__day,
.date-picker__day--empty {
  min-height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid #d2d2d2;
  background: #ffffff;
  color: #4a4a4a;
  font-size: 0.78rem;
}

.date-picker__day {
  padding: 0;
  cursor: pointer;
}

.date-picker__day:hover {
  background: #f3f3f3;
}

.date-picker__day:disabled {
  cursor: default;
}

.date-picker__day--disabled {
  color: #b9bdc2;
  background: #ffffff;
}

.date-picker__day--disabled:hover {
  background: #ffffff;
}

.date-picker__day--selected {
  border-color: #d1cb4b;
  background: #fff6a5;
  color: #655f1c;
}

.date-picker__day--today:not(.date-picker__day--selected) {
  border-color: #9ac7ff;
}

.date-picker__day--empty {
  visibility: hidden;
}

.date-picker__day:focus-visible,
.date-picker__select:focus-visible,
.date-picker__nav:focus-visible {
  outline: 2px solid rgba(21, 120, 255, 0.35);
  outline-offset: 2px;
}

.field input::placeholder {
  color: #6e7a87;
}

.field input:focus {
  border-color: #9ac7ff;
  box-shadow: 0 0 0 3px rgba(21, 120, 255, 0.12);
}

.field.is-invalid input {
  border-color: #f06a78;
}

.error-text {
  display: none;
  margin-top: 8px;
  color: #d63a48;
  font-size: 0.88rem;
  line-height: 1.35;
}

.field.is-invalid .error-text {
  display: block;
}

.captcha-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.captcha-box {
  min-width: 124px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  background: var(--accent-navy);
  color: #ffffff;
  font-size: clamp(1.45rem, 1.18rem + 0.46vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.refresh-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-green);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.refresh-button:hover {
  transform: rotate(16deg);
}

.refresh-button:focus-visible {
  outline: 2px solid rgba(83, 209, 36, 0.4);
  outline-offset: 3px;
  border-radius: 10px;
}

.refresh-button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.submit-button,
.reset-button {
  min-width: 138px;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.submit-button {
  background: var(--accent-blue);
}

.reset-button {
  background: var(--accent-red);
}

.submit-button:hover,
.reset-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(32, 43, 56, 0.14);
}

.status-message {
  min-height: 22px;
  margin: 2px 0 0;
  color: #257c25;
  font-size: 0.92rem;
}

.status-message.is-error {
  color: #f03f4d;
}

.status-message:empty {
  display: none;
}

.disclaimer {
  margin-top: 20px;
  padding: 26px 38px 38px;
  border-top: 1px solid #ececec;
}

.disclaimer p {
  width: min(100%, 980px);
  margin: 0 auto;
  color: #30353d;
  font-size: clamp(1rem, 0.92rem + 0.26vw, 1.12rem);
  line-height: 1.7;
  text-align: center;
}

.disclaimer strong {
  font-size: 1.06em;
}

.site-footer {
  padding: 16px 24px;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: clamp(0.9rem, 0.84rem + 0.18vw, 1.06rem);
  font-weight: 600;
  text-align: center;
}

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

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
}

.result-overlay.is-visible {
  display: grid;
}

.result-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.result-overlay__spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #dfe8f3;
  border-top-color: #2a6ee8;
  border-radius: 50%;
  animation: result-spin 0.75s linear infinite;
}

.result-overlay__spinner.is-hidden {
  display: none;
}

.result-overlay__text {
  margin: 0;
  color: #2a2a2a;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@keyframes result-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 16px;
  }

  .site-header__meta {
    padding: 0;
  }

  .content-wrap {
    padding: 18px 14px 0;
  }

  .form-card {
    margin-bottom: 18px;
  }

  .card-heading,
  .result-form,
  .disclaimer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .field-label {
    padding-top: 0;
  }

  .field-label--spacer {
    display: none;
  }

  .status-message {
    margin-top: 0;
  }
}

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

  .page-shell {
    min-height: calc(100vh - var(--page-padding) - var(--page-padding));
  }

  .site-header {
    padding: 14px 14px 18px;
  }

  .content-wrap {
    padding: 14px 10px 0;
  }

  .card-heading {
    padding-top: 22px;
    padding-bottom: 18px;
  }

  .card-heading h2 {
    font-size: clamp(1.45rem, 1.12rem + 1.3vw, 2rem);
  }

  .result-form {
    padding-top: 18px;
  }

  .card-heading,
  .result-form,
  .disclaimer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field input {
    height: 40px;
    padding: 0 18px;
    font-size: 0.95rem;
  }

  .date-picker__panel {
    width: min(100%, 316px);
    min-width: 0;
  }

  .date-picker__controls {
    grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) 20px;
    gap: 4px;
    padding: 4px 5px;
  }

  .date-picker__select {
    height: 30px;
    padding: 0 7px;
    font-size: 0.76rem;
  }

  .date-picker__weekdays span {
    min-height: 27px;
    font-size: 0.78rem;
  }

  .date-picker__day,
  .date-picker__day--empty {
    min-height: 32px;
    font-size: 0.74rem;
  }

  .captcha-entry {
    gap: 8px;
  }

  .captcha-box {
    min-width: 146px;
    height: 44px;
  }

  .refresh-button {
    width: 42px;
    height: 42px;
  }

  .form-actions {
    justify-content: end;
  }

  .submit-button,
  .reset-button {
    min-width: 106px;
  }

  .disclaimer {
    padding-top: 22px;
    padding-bottom: 28px;
  }

  .site-footer {
    padding: 14px 16px;
  }
}

@media (max-width: 420px) {
  .site-session {
    font-size: 0.92rem;
  }

  .captcha-box {
    min-width: 132px;
    font-size: 1.32rem;
  }
}
