/* ==========================================================
   WHALE OS Input System - Relate Style
   ========================================================== */

:root {
  --input-height-sm: 32px;
  --input-height-md: 40px;
  --input-height-lg: 48px;

  --input-padding-inline: 14px;
  --input-padding-block: 8px;
  --input-bg: #ffffff;
  --input-border: var(--stone-divider, #e2e8f0);
  --input-border-hover: #cbd5e1;
  --input-border-focus: var(--primary, #145aff);
}

/* Base Inputs */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  height: var(--input-height-md);
  background: var(--input-bg);
  color: var(--midnight-ink, #020520);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input, 10px);
  padding: 0 var(--input-padding-inline);
  font-family: inherit;
  font-size: var(--fs-body, 13.5px);
  font-weight: var(--fw-normal, 400);
  line-height: normal;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  outline: none;
  box-sizing: border-box;
}

textarea {
  height: auto;
  min-height: 90px;
  padding: 10px var(--input-padding-inline);
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
  padding-inline-end: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  appearance: none;
}

[dir="ltr"] select {
  background-position: right 12px center;
}

/* Placeholder */
.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--ash-helper, #9ca3af);
  font-weight: 400;
}

/* Sizes */
.input-sm {
  height: var(--input-height-sm);
  font-size: var(--fs-caption, 12px);
  padding: 0 10px;
  border-radius: var(--radius-sm, 8px);
}

.input-md {
  height: var(--input-height-md);
}

.input-lg {
  height: var(--input-height-lg);
  font-size: var(--fs-subhead, 15px);
  padding: 0 16px;
  border-radius: var(--radius-md, 12px);
}

/* States */
.input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: var(--input-border-hover);
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(20, 90, 255, 0.12);
  background-color: #ffffff;
}

.input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--fog-surface, #f8fafc);
  color: var(--ash-helper, #9ca3af);
  border-color: var(--stone-divider, #e2e8f0);
  cursor: not-allowed;
  opacity: 0.75;
}

/* Labels & Hints */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  color: var(--midnight-ink, #020520);
  font-size: var(--fs-caption, 12.5px);
  font-weight: var(--fw-medium, 500);
}

.form-hint {
  color: var(--ash-helper, #6b7280);
  font-size: 11.5px;
}

.form-error {
  color: var(--coral-lost, #f26052);
  font-size: 11.5px;
  font-weight: 500;
}

.form-success {
  color: var(--mint-win, #16ca2e);
  font-size: 11.5px;
  font-weight: 500;
}

/* Search Input with RTL Support */
.input-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
}

.input-search input {
  padding-inline-start: 36px;
  padding-inline-end: 14px;
}

.input-search .icon,
.input-search i {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ash-helper, #9ca3af);
  pointer-events: none;
  font-size: 14px;
}
