/* modals.css — Modal, form, stepper, accordion, picker, dropzone */

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-overlay.open {
  display: flex;
}
@media (min-width: 701px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
}
.modal {
  width: min(100%, 860px);
  max-height: 95vh;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 701px) {
  .modal {
    border-radius: 18px;
    max-height: 90vh;
  }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0)) 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  z-index: 1;
  flex-shrink: 0;
}
.modal-body {
  padding: 16px;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--card);
  flex-shrink: 0;
  padding-bottom: calc(12px + var(--safe-bottom));
}
.modal-foot .status {
  flex: 1;
  min-width: 0;
}
.close-btn {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}
.close-btn:hover {
  color: var(--text);
  background: var(--card2);
}

/* Form */
.form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}
.form-input,
.form-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.15);
}
.form-input.err,
.form-select.err {
  border-color: var(--err);
}
.form-group {
  display: grid;
  gap: 5px;
}
.field-help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.field-error {
  font-size: 11px;
  color: var(--err);
  margin-top: 2px;
  font-weight: 500;
}
.section {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Aşama stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.step.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #1f2a0a;
}
.step.done .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #1f2a0a;
}
.step.done .step-dot::after {
  content: "✓";
}
.step.done .step-dot {
  font-size: 0;
}
.step.done .step-dot::after {
  font-size: 14px;
}
.step-line {
  height: 2px;
  width: 24px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}
.step.done + .step .step-line,
.step.active + .step .step-line {
  background: var(--border);
}
.step.done ~ .step .step-line {
  background: var(--accent);
}

/* Aşama accordion */
.stage-acc {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card2);
}
.stage-acc-head {
  border-radius: 12px 12px 0 0;
}
.stage-acc-body {
  border-radius: 0 0 12px 12px;
}
.stage-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 10px;
}
.stage-acc-head:hover:not(:disabled) {
  background: #eef2f7;
}
.stage-acc-head:disabled {
  cursor: not-allowed;
}
.stage-acc-head .step-dot {
  margin-right: 8px;
}
.stage-acc-name {
  font-size: 14px;
  font-weight: 700;
}
.stage-acc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.stage-acc-arrow {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.stage-acc-body {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: grid;
  gap: 10px;
}
.stage-acc-body.closed {
  display: none;
}

/* Picker */
.picker-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.picker-details summary {
  padding: 11px 12px;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  gap: 8px;
}
.picker-details summary::-webkit-details-marker {
  display: none;
}
.picker-details summary::after {
  content: "▾";
  color: var(--muted);
  flex-shrink: 0;
}
.picker-details[open] summary::after {
  content: "▴";
}
.picker-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 32px 10px 12px;
  font-size: 16px;
  outline: none;
  background: #fafafa;
}
.search-wrap {
  position: relative;
}
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: none;
}
.search-clear.show {
  display: block;
}
.picker-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 2px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.picker-item:hover {
  background: var(--card2);
}
.picker-item input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.dropzone.drag {
  border-color: var(--accent);
  background: #f7fee7;
}
.dropzone-icon {
  font-size: 28px;
  opacity: 0.7;
}
.dropzone-text {
  font-size: 13px;
  color: var(--muted);
}
.dropzone-text strong {
  color: var(--text);
}
.dropzone-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.file-input-hidden {
  position: absolute;
  left: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
}
