/* ================================================================
   MODAL — Overlay, formulários e editor de tags
   ================================================================ */

/* ── Overlay ─────────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.overlay.on { display: flex; }

/* ── Modal container ─────────────────────────────────────────── */
.modal {
  background: var(--s1);
  border-radius: 22px 22px 0 0;
  padding: 18px 20px 44px;
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid var(--bdr2);
  max-height: 92vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.m-handle {
  width: 34px;
  height: 4px;
  background: var(--bdr2);
  border-radius: 4px;
  margin: 0 auto 16px;
}

.m-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── Form elements ───────────────────────────────────────────── */
.fg { margin-bottom: 16px; }

.flbl {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}

.finput,
.fsel {
  width: 100%;
  background: var(--s2);
  border: 1.5px solid var(--bdr2);
  border-radius: var(--rs);
  color: var(--txt);
  font-size: 15px;
  padding: 11px 13px;
  outline: none;
  transition: border-color var(--trans);
  -webkit-appearance: none;
  appearance: none;
}

.finput:focus,
.fsel:focus { border-color: var(--purple); }

.fsel option { background: #1a1a2e; }

.frow         { display: flex; gap: 9px; }
.frow .fg     { flex: 1; }

/* ── Tag editor ──────────────────────────────────────────────── */
.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-option {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--bdr2);
  background: var(--s2);
  color: var(--muted);
  transition: var(--trans);
  user-select: none;
}

.tag-option.sel {
  background: var(--purple-bg);
  border-color: var(--purple);
  color: var(--purple);
}

.tag-custom-wrap {
  display: flex;
  gap: 7px;
  margin-top: 6px;
  width: 100%;
}

.tag-custom-input {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
}

.tag-add-btn {
  padding: 0 14px;
  background: var(--s3);
  border: 1px solid var(--bdr2);
  border-radius: var(--rs);
  color: var(--purple);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--trans);
}

.tag-add-btn:hover { background: var(--purple-bg); }

/* ── Type picker (modal rápido) ──────────────────────────────── */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.type-btn {
  background: var(--s2);
  border: 1px solid var(--bdr);
  border-radius: 13px;
  padding: 16px 8px;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.type-btn:hover {
  background: var(--s3);
  border-color: var(--bdr2);
}

.type-icon  { font-size: 24px; }
.type-label { font-size: 12px; font-weight: 500; }

/* ── Form buttons ────────────────────────────────────────────── */
.btn-ok {
  width: 100%;
  padding: 14px;
  background: var(--purple);
  color: #fff;
  border-radius: var(--rs);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-ok:active {
  transform: scale(0.98);
  opacity: 0.88;
}

.btn-ok:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-ok-spin {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.btn-cancel {
  width: 100%;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
}
