*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #d8e1ea;
  --text: #334155;
  --text-muted: #64748b;
  --title: #0f3d6e;
  --primary: #0f3d6e;
  --primary-hover: #1d5da8;
  --primary-soft: rgba(15, 61, 110, 0.08);
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fcd34d;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(15, 61, 110, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  min-height: 100%;
  width: 100%;
}

html {
  font-family: "Inter", system-ui, sans-serif;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.embedded,
body.embedded .page {
  background: #ffffff;
}

.page {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.form-wrap {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-header {
  margin-bottom: 1.5rem;
}

.form-header h1 {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--title);
}

.form-intro {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--title);
}

.input-wrap {
  --ring-angle: 0deg;
  position: relative;
  display: block;
  border-radius: 8px;
}

.input-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from -90deg,
    var(--primary) 0deg,
    var(--primary) var(--ring-angle),
    transparent var(--ring-angle)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.input-wrap.is-drawing::before,
.input-wrap.is-focused::before {
  opacity: 1;
}

.input-wrap.is-focused::before {
  --ring-angle: 360deg;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s var(--ease);
  position: relative;
  z-index: 1;
}

.input-wrap input:hover,
.input-wrap select:hover,
.input-wrap textarea:hover {
  border-color: rgba(15, 61, 110, 0.28);
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  outline: none;
}

.input-wrap.is-drawing input,
.input-wrap.is-drawing select,
.input-wrap.is-drawing textarea {
  border-color: var(--border);
}

.input-wrap.is-focused input,
.input-wrap.is-focused select,
.input-wrap.is-focused textarea {
  border-color: var(--primary);
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: #94a3b8;
}

.input-wrap textarea {
  min-height: 7rem;
  resize: vertical;
  display: block;
}

.input-wrap textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.input-wrap.is-focused textarea:disabled {
  border-color: var(--border);
}

.input-wrap select {
  cursor: pointer;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .input-wrap::before {
    display: none;
  }

  .input-wrap input:focus,
  .input-wrap select:focus,
  .input-wrap textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 61, 110, 0.1);
  }
}

.field-hint {
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--danger);
}

.spam-panel {
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
}

.spam-panel[hidden] {
  display: none;
}

.spam-panel-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--warning);
}

.spam-panel-text {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
}

.spam-panel-text a {
  color: var(--primary);
  font-weight: 600;
}

.form-actions {
  margin-top: 0.25rem;
}

.btn-submit {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 61, 110, 0.18);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled,
.btn-submit[hidden] {
  display: none;
}

.status-panel {
  margin-top: 1.25rem;
  padding: 1.25rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.status-panel[hidden] {
  display: none;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 700;
}

.status-icon--success {
  background: var(--success-soft);
  color: var(--success);
}

.status-icon--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-panel h2 {
  margin-top: 0.65rem;
  font-size: 1.05rem;
  color: var(--title);
}

.status-message {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.btn-reset {
  margin-top: 1rem;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(15, 61, 110, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.btn-reset:hover {
  background: rgba(15, 61, 110, 0.12);
}

.form-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 540px) {
  .page {
    padding: 1.5rem 1rem 2rem;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
