.nice-password-input,
.nice-text-input,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  padding: 9px 12px;
  background: var(--background-light);
  color: var(--font-dark);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
  box-sizing: border-box;
}

textarea {
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  width: 100%;
}

.nice-password-input:hover,
.nice-text-input:hover,
textarea:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
input[type="month"]:hover,
input[type="week"]:hover,
select:hover {
  border-color: var(--border-input-hover);
}

.nice-password-input:focus,
.nice-text-input:focus,
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    var(--focus-ring);
  background: var(--background-light);
}

.nice-password-input:disabled,
.nice-text-input:disabled,
textarea:disabled,
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
input[type="url"]:disabled,
input[type="tel"]:disabled,
input[type="date"]:disabled,
input[type="time"]:disabled,
input[type="datetime-local"]:disabled,
input[type="month"]:disabled,
input[type="week"]:disabled,
select:disabled {
  background: var(--surface-subtle);
  color: var(--font-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.nice-password-input[readonly],
.nice-text-input[readonly],
textarea[readonly],
input[type="text"][readonly],
input[type="password"][readonly],
input[type="email"][readonly],
input[type="number"][readonly],
input[type="search"][readonly],
input[type="url"][readonly],
input[type="tel"][readonly] {
  background: var(--surface-subtle);
  color: var(--font-muted);
}

.nice-password-input::placeholder,
.nice-text-input::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--font-muted);
  opacity: 1;
}

/* Number input: keep native spinners but make them less visually heavy */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

input[type="number"]:hover::-webkit-outer-spin-button,
input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:focus::-webkit-outer-spin-button,
input[type="number"]:focus::-webkit-inner-spin-button {
  opacity: 1;
}

/* Date/time picker indicator: subtle tint that lights up on hover/focus */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    filter 0.15s ease;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="month"]:hover::-webkit-calendar-picker-indicator,
input[type="week"]:hover::-webkit-calendar-picker-indicator,
input[type="date"]:focus::-webkit-calendar-picker-indicator,
input[type="time"]:focus::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator,
input[type="month"]:focus::-webkit-calendar-picker-indicator,
input[type="week"]:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* File input: wrap the native control in a consistent box and restyle its
   built-in selector button to match the .nice-button family. */
input[type="file"] {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-input);
  padding: 6px 10px;
  background: var(--surface-subtle);
  color: var(--font-dark);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
  max-width: 100%;
}

input[type="file"]:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

input[type="file"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input[type="file"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--surface-subtle);
  border-color: var(--border-subtle);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--background-light);
  color: var(--font-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}

input[type="file"]:hover::file-selector-button {
  background: var(--accent);
  color: var(--font-light);
  box-shadow: var(--button-shadow-hover);
}

/* WebKit/Blink legacy pseudo-element (kept for older Safari/Chrome) */
input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  border: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--background-light);
  color: var(--font-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}

input[type="file"]:hover::-webkit-file-upload-button {
  background: var(--accent);
  color: var(--font-light);
  box-shadow: var(--button-shadow-hover);
}

/* Search input: hide the default clear button styling differences across browsers */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  background: var(--font-muted);
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center / contain;
  cursor: pointer;
}
