/* Ortak form bileşenleri: alanlar, etiketler, onay kutuları, bilgi kutuları */

.form {
  display: grid;
  gap: 20px;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field__label {
  font-size: 15px;
  font-weight: 600;
}

.field__optional {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.field__hint {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* Metin kutuları */
.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 16px; /* 16px: iOS'ta otomatik yakınlaştırmayı önler */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #8A978F;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--color-sage);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-forest);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* Kullanıcı alanla etkileşime girdikten sonra hatalıysa kırmızı çerçeve */
.input:user-invalid,
.select:user-invalid,
.textarea:user-invalid {
  border-color: var(--status-high);
}

.input[readonly] {
  background: var(--color-warm-white);
  color: var(--color-text-secondary);
}

.textarea {
  min-height: 150px;
  padding: 14px 16px;
  line-height: 1.55;
  resize: vertical;
}

.select {
  padding-right: 44px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235F6E66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 18px center;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Şifre alanı + göster/gizle düğmesi */
.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-forest);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--color-mint);
}

/* Onay kutusu ve seçenek düğmeleri */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
}

.check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--color-forest);
  cursor: pointer;
}

.check--muted {
  color: var(--color-text-secondary);
}

.fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset legend {
  margin-bottom: 10px;
  padding: 0;
}

/* Hap şeklinde seçenekler (ör. 1–5 puan) */
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.choice span:hover {
  border-color: var(--color-sage);
}

.choice input:checked + span {
  border-color: var(--color-forest);
  background: var(--color-forest);
  color: #fff;
}

.choice input:focus-visible + span {
  box-shadow: var(--shadow-focus);
}

.form__inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Bilgi kutusu (ör. "Bu form henüz aktif değil") */
.notice {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid #D3E6DB;
  border-radius: 14px;
  background: var(--color-mint);
  color: var(--color-deep);
  font-size: 15px;
  line-height: 1.5;
}

.notice__title {
  font-weight: 650;
}

.notice--neutral {
  border-color: var(--color-line);
  background: var(--color-warm-white);
  color: var(--color-text-secondary);
}

.notice--neutral .notice__title {
  color: var(--color-text);
}

.notice:focus {
  outline: none;
}

@media (max-width: 560px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}
