/* Forms / modal sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 640px) {
  .sheet-backdrop {
    align-items: center;
  }
}

.sheet {
  background: var(--surface-1);
  border-radius: 20px 20px 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  animation: slide-up 0.2s ease;
}

@media (min-width: 640px) {
  .sheet {
    border-radius: 20px;
  }
}

.sheet h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.field input[type="text"],
.field input[type="password"],
.field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.color-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 0 2px transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.selected {
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px currentColor;
}

.color-swatch.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--gridline);
}

.btn:disabled {
  opacity: 0.5;
}

.form-error {
  color: var(--danger-ink);
  font-size: 13px;
  margin: -10px 0 14px;
  min-height: 16px;
}


/* "Ingen farve"-valg i farvevælgeren */
.color-swatch.color-none {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px dashed var(--baseline);
}

/* Ugedage i vane-arket */
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-toggle {
  padding: 9px 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.day-toggle.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Hyppighed i vane-arket */
.freq-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--surface-3);
}

.freq-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.freq-toggle button.active {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.every-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sub-label {
  display: block;
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.fresh-row {
  display: flex;
  gap: 8px;
}

.fresh-row input {
  flex: 1;
  min-width: 0;
}

.fresh-row .btn {
  flex: none;
  padding: 10px 16px;
}
