.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem 1.75rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(28, 25, 23, 0.18);
  animation: slideUp 0.18s ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.25rem;
}

.modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.modal-tab.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08);
}

.modal-tab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-box h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-sub {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.modal-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-field input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-muted);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.modal-field input:focus {
  border-color: var(--primary);
}

.modal-field input:disabled {
  opacity: 0.6;
}

.modal-error {
  font-size: 0.82rem;
  color: var(--error);
  margin: 0.25rem 0 0.75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.modal-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.modal-cancel:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text-main);
}

.modal-submit {
  background: var(--primary);
  border: none;
  color: var(--on-primary);
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.modal-submit:hover:not(:disabled) {
  opacity: 0.88;
}

.modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
