.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 34, 64, 0.42);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}
.modal-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(14, 165, 233, 0.05);
  animation: pop 0.22s cubic-bezier(.2,.9,.3,1.2);
}
.modal-dialog .corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 1.5px solid var(--cyan-deep);
  pointer-events: none;
}
.modal-dialog .corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.modal-dialog .corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.modal-dialog .corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.modal-dialog .corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 26px 14px;
  border-bottom: 1px dashed var(--line);
}
.modal-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--cyan-deep);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.modal-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  width: 32px; height: 32px;
  border-radius: 4px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }
.modal-body { padding: 22px 26px 4px; }

.form-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.photo-drop {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
  background: rgba(14, 165, 233, 0.05);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.18s;
  overflow: hidden;
}
.photo-drop:hover, .photo-drop:focus-visible, .photo-drop.is-drag {
  border-color: var(--cyan);
  background: rgba(14, 165, 233, 0.10);
  outline: none;
}
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-dim);
  padding: 0 10px;
}
.photo-hint strong { color: var(--cyan-deep); font-weight: 600; }
.photo-ico { font-size: 36px; line-height: 1; margin-bottom: 6px; color: var(--cyan-deep); }
.photo-tip { margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--ink-faint); }
.photo-tip kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(11, 34, 64, 0.06);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.lbl em { color: var(--amber-deep); font-style: normal; }
.field input,
.field select,
.field textarea {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.field select { cursor: pointer; }
.field textarea { font-family: inherit; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 24px;
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  gap: 12px;
  flex-wrap: wrap;
}
.modal-actions { display: flex; gap: 10px; margin-left: auto; }
.form-msg {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.form-msg.is-error { color: var(--danger); }
.form-msg.is-success { color: var(--good); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
}
