:root {
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --border: #dcdce0;
  --bg: #f6f6f8;
  --surface: #ffffff;
  --accent: #2f6fed;
  --accent-hover: #2559c4;
  --error: #c62828;
  --error-bg: #fdecea;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 64px;
}

.card {
  width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
}

.card-head h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
textarea {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
input[type="file"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea { resize: vertical; }

input[type="file"] {
  font: inherit;
  font-size: 0.88rem;
  padding: 10px 0;
}

.field-divider {
  margin: 4px 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.field-divider span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hint {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.image-preview {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 160px;
  border: 1px solid var(--border);
}

.image-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.field-error {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--error);
  background: var(--error-bg);
  padding: 8px 10px;
  border-radius: 6px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.form-status.error {
  background: var(--error-bg);
  color: var(--error);
}

.toast-overlay {
  position: fixed;
  inset: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.toast-overlay[hidden] {
  display: none;
}

.toast {
  width: 100%;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 48px 20px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

.toast-success {
  background: #e8f6ec;
  border-color: #cdebd4;
}

.toast-message {
  margin: 0;
  font-size: 0.95rem;
  color: #1e7a34;
  white-space: pre-line; /* renders \n in the message text as line breaks */
}

.toast-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #1e7a34;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.toast-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
}

.submit-btn {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.96rem;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-btn:hover { background: var(--accent-hover); }

.submit-btn:disabled {
  background: #a9c0f2;
  cursor: not-allowed;
}

@media (max-width: 380px) {
  .card { padding: 22px 18px 18px; }
}
