input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: clamp(13px, 2.4vw, 16px);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7em 0.9em;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

input::placeholder {
  color: var(--text-faint);
}

input:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent-2);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

input:focus:not(:focus-visible) {
  outline: none;
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
}

input[type="number"] {
  -moz-appearance: textfield;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: 18px center, 13px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 2em;
}

option {
  color: var(--text);
  background-color: var(--bg-2);
}

button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-sans);
  font-size: clamp(13px, 2.4vw, 16px);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65em 1.1em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    filter 0.2s var(--ease);
}

button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35);
}

a {
  font-size: clamp(13px, 2.4vw, 16px);
  color: var(--accent-2);
  text-decoration: none;
}

a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35);
  border-radius: var(--radius-xs);
}

label {
  display: flex;
  color: var(--text-dim);
  justify-content: center;
  align-items: center;
  font-size: clamp(12px, 2.2vw, 15px);
  font-weight: 600;
}

.line {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.line label {
  font-size: 14px;
  color: var(--text-dim);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-inline-end: 2.6em;
}

.password-field button {
  position: absolute;
  inset-inline-end: 4px;
  border: none;
  background: transparent;
  padding: 0.4em 0.6em;
  font-size: clamp(16px, 3vw, 19px);
  line-height: 1;
}

.password-field button:hover {
  background: var(--surface-hover);
  transform: none;
}

.btn-primary {
  color: #fff;
  background: var(--accent-grad);
  border: none;
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.28);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 10px 30px rgba(124, 108, 255, 0.4);
}

.btn-danger {
  color: #fff;
  background: var(--danger-grad);
  border: none;
  box-shadow: 0 8px 24px rgba(251, 69, 112, 0.25);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 10px 30px rgba(251, 69, 112, 0.38);
}

.bounce-button {
  animation: upDown 2.5s ease-in-out infinite;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
