/* Form controls and states */
.form-group {
  margin-bottom: var(--space-2);
}
.form-label {
  display: block;
  color: var(--gray-700);
  font-weight: 500;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}
.input-container {
  position: relative;
  /* allow toggle icon to render fully without clipping */
  overflow: visible;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.form-input {
  width: 100%;
  height: 40px;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-900);
  font-size: var(--font-size-sm);
  padding-left: 40px;
  padding-right: var(--space-3);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.form-input::placeholder {
  color: var(--gray-400);
}
.form-input:focus {
  outline: none;
  border-color: var(--info-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-input.error {
  border-color: var(--error-500) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}
.password-input {
  /* add a bit more room to the right for a bigger, centered toggle hit area */
  padding-right: calc(var(--space-5) + 36px);
}
.password-toggle {
  /* enlarge and center the tap target; ensure it's fully inside the input */
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  transition: color .15s ease-in-out, background-color .15s ease-in-out;
  z-index: 1; /* sit above input so strokes aren’t visually clipped by borders */
}
.password-toggle:hover {
  color: var(--gray-600);
  /* removed background and border radius to keep icon area clean */
}
.password-toggle .icon-eye-off {
  display: none;
}
.password-toggle.showing .icon-eye {
  display: none;
}
.password-toggle.showing .icon-eye-off {
  display: block;
}

/* Password input */
.password-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  display: block;
}

.remember-forgot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.remember-section {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.custom-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.custom-checkbox:hover {
  border-color: var(--info-500);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12), 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.custom-checkbox:checked {
  background: var(--info-500);
  border-color: var(--info-500);
}
.custom-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 0;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.signin-button {
  width: 100%;
  height: 40px;
  background: var(--gray-800);
  color: #fff;
  font-weight: 500;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color .25s ease;
  position: relative;
}
.signin-button:hover {
  background: var(--gray-700);
}
.signin-button.loading {
  color: transparent;
  pointer-events: none;
}
.signin-button .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
.signin-button.loading .loader {
  display: block;
}
.loader-dots {
  display: flex;
  gap: 4px;
}
.loader-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: dotPulse 1.4s infinite ease-in-out;
}
.loader-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.loader-dot:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes dotPulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.validation-error {
  color: var(--error-500);
  font-size: var(--font-size-xs);
  margin-top: var(--space-1);
  display: none;
}
.validation-error.show {
  display: block;
}

/* Custom textarea styles used by Gateway page */
.custom-textarea {
  width: 100%;
  min-height: 96px;
  background-color: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-900);
  font-size: var(--font-size-sm);
  padding: var(--space-3);
  resize: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.custom-textarea::placeholder {
  color: var(--gray-400);
}
.custom-textarea:focus {
  outline: none;
  border-color: var(--info-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.custom-textarea:read-only {
  background-color: var(--gray-50);
  color: var(--gray-500);
}
