:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #5f6f86;
  --line: #dbe4f0;
  --primary: #1f6feb;
  --primary-strong: #1857b8;
  --danger: #d93025;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.card {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.muted {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #86acee;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #607997 50%),
    linear-gradient(135deg, #607997 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field input[type="file"] {
  padding: 10px 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(31, 111, 235, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:hover {
  transform: translateY(-1px);
}

.error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.modal-box h3 {
  margin: 0 0 8px;
}

.modal-box p {
  margin: 0 0 12px;
  color: var(--danger);
}

.install-pwa-btn {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 80;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(31, 111, 235, 0.26);
  cursor: pointer;
}

.ios-install-hint {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 6px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px 42px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(31, 42, 55, 0.14);
  backdrop-filter: blur(10px);
}

.ios-install-hint strong {
  font-size: 14px;
}

.ios-install-hint span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ios-install-hint-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .install-pwa-btn {
    right: 12px;
    bottom: 96px;
    padding: 12px 16px;
  }

  .ios-install-hint {
    right: 12px;
    bottom: 96px;
  }
}
