/* cignyl-sftp 20260824 */
/* ------------------------------ */
/* v2 Input (text input)          */
/* ------------------------------ */

.v2-theme .v2-input {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-xsm);

  --v2-input-height: 2.25rem; /* default (36px) */
  --v2-input-pad-x: var(--v2-space-sm);
  --v2-input-icon-hit: 2.25rem; /* matches default height */

  --v2-input-border: hsl(var(--input));
  --v2-input-bg: hsl(var(--background));
  --v2-input-fg: hsl(var(--foreground));
  --v2-input-muted: hsl(var(--muted-foreground));
  --v2-input-ring: hsl(var(--ring));
  --v2-input-accent: hsl(var(--primary));
}

.v2-theme .v2-input__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--v2-space-md);
}

.v2-theme .v2-input__label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--foreground));
  min-width: 0;
}

.v2-theme .v2-input__required {
  color: hsl(var(--destructive));
  font-weight: 700;
  line-height: 1;
}

.v2-theme .v2-input__label-right-slot {
  flex: 0 0 auto;
}

.v2-theme .v2-input__description {
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--v2-input-muted);
}

.v2-theme .v2-input__message {
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--v2-input-muted);
}

.v2-theme .v2-input__control {
  display: flex;
  align-items: stretch;
  width: 100%;

  background: var(--v2-input-bg);
  border: 1px solid var(--v2-input-border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;

  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.v2-theme .v2-input__control:focus-within {
  border-color: var(--v2-input-accent);
  /*
   * Subtle focus affordance (avoid the thick “double ring” look):
   * - thin accent outline
   * - soft elevation shadow
   */
  box-shadow:
    0 0 0 1px var(--v2-input-accent),
    0 1px 2px hsl(var(--foreground) / 0.08);
}

.v2-theme .v2-input--disabled-true {
  opacity: 0.65;
  pointer-events: none;
}

.v2-theme .v2-input__addon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--v2-input-height);
  padding: 0 var(--v2-input-pad-x);
  font-size: 0.875rem;
  color: var(--v2-input-muted);
  background: hsl(var(--muted) / 0.35);
  white-space: nowrap;
}

.v2-theme .v2-input__addon--prefix {
  border-right: 1px solid hsl(var(--border));
}
.v2-theme .v2-input__addon--suffix {
  border-left: 1px solid hsl(var(--border));
}

.v2-theme .v2-input__btn {
  all: unset;
  box-sizing: border-box;
  height: var(--v2-input-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--v2-space-xsm);
  padding: 0 var(--v2-input-pad-x);

  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;

  color: hsl(var(--foreground));
  background: hsl(var(--background));
  transition: background-color 120ms ease, color 120ms ease;
}

.v2-theme .v2-input__btn:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

.v2-theme .v2-input__btn--left {
  border-right: 1px solid hsl(var(--border));
}

.v2-theme .v2-input__btn--right {
  border-left: 1px solid hsl(var(--border));
}

.v2-theme .v2-input__btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95em;
}

.v2-theme .v2-input__btn--icon-right {
  flex-direction: row-reverse;
}

/* button variants (subtle, input-group friendly) */
.v2-theme .v2-input__btn--variant-default { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.v2-theme .v2-input__btn--variant-default:hover { background: hsl(var(--primary) / 0.9); }
.v2-theme .v2-input__btn--variant-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.v2-theme .v2-input__btn--variant-secondary:hover { background: hsl(var(--secondary) / 0.85); }
.v2-theme .v2-input__btn--variant-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.v2-theme .v2-input__btn--variant-destructive:hover { background: hsl(var(--destructive) / 0.9); }
.v2-theme .v2-input__btn--variant-success { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.v2-theme .v2-input__btn--variant-success:hover { background: hsl(var(--success) / 0.9); }
.v2-theme .v2-input__btn--variant-warning { background: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }
.v2-theme .v2-input__btn--variant-warning:hover { background: hsl(var(--warning) / 0.9); }
.v2-theme .v2-input__btn--variant-info { background: hsl(var(--info)); color: hsl(var(--info-foreground)); }
.v2-theme .v2-input__btn--variant-info:hover { background: hsl(var(--info) / 0.9); }
.v2-theme .v2-input__btn--variant-outline { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.v2-theme .v2-input__btn--variant-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.v2-theme .v2-input__btn--variant-ghost { background: transparent; }
.v2-theme .v2-input__btn--variant-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.v2-theme .v2-input__btn--variant-link { background: transparent; color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 4px; }
.v2-theme .v2-input__btn--variant-link:hover { color: hsl(var(--primary) / 0.85); }

.v2-theme .v2-input__input-wrap {
  position: relative;
  flex: 1 1 auto;
  height: var(--v2-input-height);
  min-width: 0;
}

.v2-theme .v2-input__input {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 var(--v2-input-pad-x);
  font-size: 0.875rem;
  color: var(--v2-input-fg);
}

.v2-theme .v2-input__input::placeholder {
  color: var(--v2-input-muted);
}

.v2-theme .v2-input__icon-btn {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--v2-input-icon-hit);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--v2-input-muted);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.v2-theme .v2-input__icon-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.v2-theme .v2-input__icon-btn:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 0.8;
}

.v2-theme .v2-input__icon-btn--left { left: 0; }
.v2-theme .v2-input__icon-btn--right { right: 0; }

.v2-theme .v2-input__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95em;
}

/* icon padding tokens */
.v2-theme .v2-input--icon-left-true .v2-input__input { padding-left: calc(var(--v2-input-pad-x) + var(--v2-input-icon-hit)); }
.v2-theme .v2-input--icon-right-true .v2-input__input { padding-right: calc(var(--v2-input-pad-x) + var(--v2-input-icon-hit)); }

/* sizes */
.v2-theme .v2-input--size-xsm { --v2-input-height: 1.75rem; --v2-input-pad-x: var(--v2-space-xsm); --v2-input-icon-hit: 1.75rem; }
.v2-theme .v2-input--size-sm  { --v2-input-height: 2rem;    --v2-input-pad-x: var(--v2-space-xsm); --v2-input-icon-hit: 2rem; }
.v2-theme .v2-input--size-default { --v2-input-height: 2.25rem; --v2-input-pad-x: var(--v2-space-sm); --v2-input-icon-hit: 2.25rem; }
.v2-theme .v2-input--size-lg  { --v2-input-height: 2.5rem;  --v2-input-pad-x: var(--v2-space-md); --v2-input-icon-hit: 2.5rem; }
.v2-theme .v2-input--size-xlg { --v2-input-height: 2.75rem; --v2-input-pad-x: var(--v2-space-md); --v2-input-icon-hit: 2.75rem; }

/* variants (accent + ring color) */
.v2-theme .v2-input--variant-default    { --v2-input-accent: hsl(var(--primary)); --v2-input-ring: hsl(var(--ring)); }
.v2-theme .v2-input--variant-secondary  { --v2-input-accent: hsl(var(--secondary-foreground)); --v2-input-ring: hsl(var(--ring)); }
.v2-theme .v2-input--variant-destructive{ --v2-input-accent: hsl(var(--destructive)); --v2-input-ring: hsl(var(--destructive)); }
.v2-theme .v2-input--variant-success    { --v2-input-accent: hsl(var(--success)); --v2-input-ring: hsl(var(--success)); }
.v2-theme .v2-input--variant-warning    { --v2-input-accent: hsl(var(--warning)); --v2-input-ring: hsl(var(--warning)); }
.v2-theme .v2-input--variant-info       { --v2-input-accent: hsl(var(--info)); --v2-input-ring: hsl(var(--info)); }
.v2-theme .v2-input--variant-outline    { --v2-input-accent: hsl(var(--primary)); --v2-input-ring: hsl(var(--ring)); --v2-input-bg: transparent; }
.v2-theme .v2-input--variant-ghost      { --v2-input-accent: hsl(var(--primary)); --v2-input-ring: hsl(var(--ring)); --v2-input-bg: transparent; }

/* outline/ghost surface behaviors */
.v2-theme .v2-input--variant-outline .v2-input__control:focus-within,
.v2-theme .v2-input--variant-ghost .v2-input__control:focus-within {
  background: hsl(var(--background));
}

.v2-theme .v2-input--variant-ghost .v2-input__control:hover {
  background: hsl(var(--muted) / 0.25);
}

/* statuses (border + message tone) */
.v2-theme .v2-input--status-default { --v2-input-border: hsl(var(--input)); }
.v2-theme .v2-input--status-error { --v2-input-border: hsl(var(--destructive)); }
.v2-theme .v2-input--status-error .v2-input__message { color: hsl(var(--destructive)); }
.v2-theme .v2-input--status-success { --v2-input-border: hsl(var(--success)); }
.v2-theme .v2-input--status-success .v2-input__message { color: hsl(var(--success)); }
.v2-theme .v2-input--status-warning { --v2-input-border: hsl(var(--warning)); }
.v2-theme .v2-input--status-warning .v2-input__message { color: hsl(var(--warning)); }
.v2-theme .v2-input--status-info { --v2-input-border: hsl(var(--info)); }
.v2-theme .v2-input--status-info .v2-input__message { color: hsl(var(--info)); }

/* ghost is borderless by default, but still allows status overrides */
.v2-theme .v2-input--variant-ghost.v2-input--status-default .v2-input__control {
  border-color: transparent;
}

