/* Base Input Styles */
.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 16px;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input::placeholder,
.textarea::placeholder,
.select {
  color: var(--color-text-tertiary);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: var(--shadow-focus);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.5);
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2338bdf8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
  cursor: pointer;
}

.select:disabled {
  cursor: not-allowed;
}

/* Error State */
.input--error,
.textarea--error,
.select--error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.input--error:focus,
.textarea--error:focus,
.select--error:focus {
  border-color: var(--color-error);
}

/* Success State */
.input--success,
.textarea--success,
.select--success {
  border-color: var(--color-success);
}

/* Size Variants */
.input--sm {
  padding: 8px 12px;
  font-size: 14px;
}

.input--lg {
  padding: 14px 16px;
  font-size: 18px;
}

/* Form Field Container */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
}

.field__label--required::after {
  content: ' *';
  color: var(--color-error);
}

.field__input {
  width: 100%;
}

.field__helper {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: -4px;
}

.field__error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: -4px;
}

/* Checkbox & Radio Base */
.checkbox,
.radio {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary-accent);
  cursor: pointer;
  margin-right: 8px;
}

.radio {
  width: 16px;
  height: 16px;
}

.checkbox:disabled,
.radio:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Checkbox/Radio Container */
.control {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.control__label {
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 16px;
}

.control:has(input:disabled) .control__label {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: rgba(148, 163, 184, 0.3);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-base);
  padding: 0;
  display: inline-block;
  vertical-align: middle;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left var(--transition-base);
}

.toggle:checked {
  background: var(--color-primary-accent);
}

.toggle:checked::after {
  left: 22px;
}

.toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
