:root {
  color-scheme: light;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: #f8f8f8;
  --text: #18181b;
  --text-muted: #6b7280;
  --border: #d4d4d8;
  --accent: #27272a;
  --accent-text: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.app__header {
  margin-bottom: 16px;
}

.app__header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

.app__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field > label {
  font-weight: 600;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 39, 42, 0.12);
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  font-weight: 600;
  cursor: pointer;
}

.file-button:hover {
  border-color: var(--accent);
}

.photos-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.photo {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 24, 27, 0.78);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 18px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

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

.button {
  flex: 1 1 160px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button--primary:hover:not(:disabled) {
  background: #3f3f46;
}

.button--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.status {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  white-space: pre-wrap;
}

.status:not(:empty) {
  display: block;
}

.status--error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #fecdca;
}

.status--success {
  color: var(--success);
  background: var(--success-bg);
  border-color: #abefc6;
}

.status--info {
  color: var(--text);
  background: var(--surface);
}

.preview h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.preview__text {
  margin: 0;
  padding: 12px;
  min-height: 80px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 420px) {
  .app {
    padding: 14px 12px 28px;
  }

  .card {
    padding: 14px;
  }

  .button {
    flex-basis: 100%;
  }
}
