*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --white: #ffffff;
  --brand: #922021;
  --brand-hover: #731935;
  --btn-bg: #922021;
  --text: #1d1d1d;
  --text-muted: #5c5c5c;
  --border: #e2e6ef;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --success: #0d7a4d;
  --error: #c62828;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(29, 29, 29, 0.08);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  background: var(--white);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.iframe-form {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
}

.iframe-form__header {
  margin-bottom: 1.25rem;
  text-align: center;
}

.iframe-form__title {
  margin: 0 0 0.35rem;
  font-size: 16px;
  font-weight: 700;
}

.iframe-form__subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.45;
}

.iframe-form__card {
  padding: 1.25rem 1.15rem 1.35rem;
}

.iframe-form__group {
  margin-bottom: 1rem;
}

.iframe-form__group:last-of-type {
  margin-bottom: 0.75rem;
}

.iframe-form__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.iframe-form__label span {
  color: var(--error);
}

.iframe-form__input,
.iframe-form__textarea {
  width: 100%;
  padding: 0.62rem 0.75rem;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.iframe-form__input:focus,
.iframe-form__textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138, 30, 65, 0.2);
}

.iframe-form__input:invalid:not(:focus):not(:placeholder-shown),
.iframe-form__textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #e57373;
}

.iframe-form__textarea {
  min-height: 88px;
  resize: vertical;
}

.iframe-form__hint {
  margin-top: 0.25rem;
  font-size: 16px;
  color: var(--text-muted);
}

.iframe-form__error {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
  color: var(--error);
  background: #ffebee;
  border-radius: 8px;
}

.iframe-form__error.is-visible {
  display: block;
}

.iframe-form__submit,
.iframe-form__reset {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  color: #ffffff;
  background-color: #922021;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
}

.iframe-form__submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.72rem 1rem;
}

.iframe-form__submit:hover:not(:disabled),
.iframe-form__reset:hover {
  background-color: var(--brand-hover);
  color: #ffffff;
}

.iframe-form__submit:active:not(:disabled),
.iframe-form__reset:active {
  transform: scale(0.99);
}

.iframe-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.iframe-form__success {
  display: none;
  text-align: center;
  padding: 2rem 1.25rem;
}

.iframe-form__success.is-visible {
  display: block;
}

.iframe-form__success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #e8f5e9;
  color: var(--success);
  font-size: 16px;
  line-height: 56px;
}

.iframe-form__success-title {
  margin: 0 0 0.5rem;
  font-size: 16px;
  font-weight: 700;
}

.iframe-form__success-text {
  margin: 0 0 1.25rem;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.iframe-form__reset {
  display: inline-block;
  padding: 0.72rem 1.5rem;
}

.iframe-form.is-submitted .iframe-form__card,
.iframe-form.is-submitted .iframe-form__header {
  display: none;
}

@media (min-width: 480px) {
  .iframe-form {
    padding: 1.5rem 1.25rem 2rem;
  }

  .iframe-form__card {
    padding: 1.5rem 1.35rem 1.5rem;
  }
}
