/* ===== INPUT COMPONENT ===== */

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.glow-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 10px);
  padding: 0 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  z-index: 0;
}

.glow-input::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--glow-rgb), .75), transparent 40%);
}

.glow-input::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: var(--bg-input, var(--bg-elevated, #0f0f23));
}

.glow-input:hover::before,
.glow-input:focus-within::before {
  opacity: 1;
}

.glow-input:focus-within {
  border-color: transparent;
}

.glow-input input,
.glow-input select,
.glow-input textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.glow-input input:focus,
.glow-input select:focus,
.glow-input textarea:focus,
.form-group .glow-input input:focus,
.form-group .glow-input select:focus,
.form-group .glow-input textarea:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.glow-input.password-input-wrap .password-toggle {
  position: relative;
  z-index: 2;
}

.glow-input input,
.glow-input select {
  padding: 12px 0;
}

.glow-input textarea {
  padding: 12px 0;
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.glow-input select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
}

.glow-input--select {
  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='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

[data-theme="light"] .glow-input--select {
  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%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.glow-input input::placeholder,
.glow-input textarea::placeholder {
  color: var(--text-muted, rgba(255, 255, 255, 0.35));
}

/*
  Browser autofill draws a flat rectangle (sharp corners, light fill) that ignores theme.
  Box-shadow inset paints the “fill”; long transition defers WebKit’s yellow flash.
*/
.glow-input input:-webkit-autofill,
.glow-input input:-webkit-autofill:hover,
.glow-input input:-webkit-autofill:focus,
.glow-input input:-webkit-autofill:active,
.glow-input textarea:-webkit-autofill,
.glow-input textarea:-webkit-autofill:hover,
.glow-input textarea:-webkit-autofill:focus,
.glow-input select:-webkit-autofill,
.glow-input select:-webkit-autofill:hover,
.glow-input select:-webkit-autofill:focus,
.glow-input input:-internal-autofill-selected,
.glow-input textarea:-internal-autofill-selected,
.glow-input select:-internal-autofill-selected {
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input, var(--bg-elevated, #0f0f23)) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-input, var(--bg-elevated, #0f0f23)) inset !important;
  border-radius: calc(var(--radius-md, 10px) - 2px);
  background-color: transparent !important;
  transform: translateZ(0);
  transition: background-color 99999s ease-out, box-shadow 99999s ease-out, -webkit-box-shadow 99999s ease-out !important;
}

.glow-input input:-moz-autofill {
  background-color: transparent !important;
}

[data-theme="light"] .glow-input input:-webkit-autofill,
[data-theme="light"] .glow-input input:-webkit-autofill:hover,
[data-theme="light"] .glow-input input:-webkit-autofill:focus,
[data-theme="light"] .glow-input input:-webkit-autofill:active,
[data-theme="light"] .glow-input textarea:-webkit-autofill,
[data-theme="light"] .glow-input textarea:-webkit-autofill:hover,
[data-theme="light"] .glow-input textarea:-webkit-autofill:focus,
[data-theme="light"] .glow-input select:-webkit-autofill,
[data-theme="light"] .glow-input select:-webkit-autofill:hover,
[data-theme="light"] .glow-input select:-webkit-autofill:focus,
[data-theme="light"] .glow-input input:-internal-autofill-selected,
[data-theme="light"] .glow-input textarea:-internal-autofill-selected,
[data-theme="light"] .glow-input select:-internal-autofill-selected {
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-white, #ffffff) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-white, #ffffff) inset !important;
  border-radius: calc(var(--radius-md, 10px) - 2px);
  background-color: transparent !important;
  transform: translateZ(0);
}

/* Plain inputs (modals, legacy markup) not wrapped in .glow-input */
input.ri-input:-webkit-autofill,
input.ri-input:-webkit-autofill:hover,
input.ri-input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input, var(--bg-elevated, #0f0f23)) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-input, var(--bg-elevated, #0f0f23)) inset !important;
  border-radius: calc(var(--radius-md, 10px) - 2px);
  transform: translateZ(0);
  transition: background-color 99999s ease-out, box-shadow 99999s ease-out, -webkit-box-shadow 99999s ease-out !important;
}

[data-theme="light"] input.ri-input:-webkit-autofill,
[data-theme="light"] input.ri-input:-webkit-autofill:hover,
[data-theme="light"] input.ri-input:-webkit-autofill:focus,
[data-theme="light"] textarea:-webkit-autofill,
[data-theme="light"] select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-white) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-white) inset !important;
}

.glow-input:focus-within {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

/* --- Light theme --- */
[data-theme="light"] .glow-input {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="light"] .glow-input input,
[data-theme="light"] .glow-input select,
[data-theme="light"] .glow-input textarea {
  color: var(--text-primary);
}

[data-theme="light"] .glow-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

[data-theme="light"] .glow-input::before,
[data-theme="light"] .glow-input::after {
  display: none;
}

/* --- Input wrapper (EJS component) --- */
.ri-input-wrap {
  position: relative;
}

.ri-input-wrap .ri-input--has-icon {
  padding-left: 40px;
}

.ri-input-wrap .ri-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.ri-input-wrap .ri-input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

/* Email icon in profile */
.email-input-wrapper {
  gap: 10px;
}

.email-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.email-icon svg {
  width: 18px;
  height: 18px;
}
