/**
 * VPM Auth — reference sign-in / sign-up (vantagepromarket.com)
 */

.vpm-auth-ref {
  --vpm-auth-primary: #f97316;
  --vpm-auth-primary-hover: #ea580c;
  --vpm-auth-bg: hsl(0 0% 4%);
  --vpm-auth-card: hsl(0 0% 9%);
  --vpm-auth-border: hsl(0 0% 20%);
  --vpm-auth-text: #fafafa;
  --vpm-auth-muted: hsl(0 0% 63%);
  --vpm-auth-input-bg: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--vpm-auth-bg);
  color: var(--vpm-auth-text);
  font-family: var(--vpm-font-sans);
  -webkit-font-smoothing: antialiased;
}

[data-theme='light'] .vpm-auth-ref {
  --vpm-auth-bg: #ffffff;
  --vpm-auth-card: #ffffff;
  --vpm-auth-border: #e4e4e7;
  --vpm-auth-text: #09090b;
  --vpm-auth-muted: #52525b;
}

.vpm-auth-ref__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  min-height: 100dvh;
  padding: 24px 16px;
}

.vpm-auth-ref__logo .vpm-logo__img {
  width: min(230px, 70vw);
  height: auto;
}

.vpm-auth-ref__card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--vpm-auth-border);
  border-radius: 12px;
  background: var(--vpm-auth-card);
  color: var(--vpm-auth-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.vpm-auth-ref__card--wide {
  max-width: 480px;
}

.vpm-auth-ref__card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.vpm-auth-ref__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.vpm-auth-ref__row {
  display: grid;
  gap: 24px;
}

@media (min-width: 480px) {
  .vpm-auth-ref__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Floating label field */
.vpm-auth-float {
  position: relative;
  width: 100%;
}

.vpm-auth-float__icon,
.vpm-auth-float__toggle {
  position: absolute;
  left: 8px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--vpm-auth-muted);
  cursor: default;
  pointer-events: none;
}

.vpm-auth-float__toggle {
  cursor: pointer;
  pointer-events: auto;
}

.vpm-auth-float__toggle .material-icons {
  font-size: 18px;
}

.vpm-auth-float__icon {
  font-size: 18px;
}

.vpm-auth-float__control {
  position: relative;
}

.vpm-auth-float__input {
  width: 100%;
  height: 48px;
  padding: 12px 12px 12px 40px;
  border: 1px solid var(--vpm-auth-border);
  border-radius: 8px;
  background: var(--vpm-auth-input-bg);
  color: var(--vpm-auth-text);
  font: inherit;
  font-size: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.vpm-auth-float__input:focus {
  outline: none;
  border-color: var(--vpm-auth-primary);
  box-shadow: 0 0 0 1px var(--vpm-auth-primary);
}

.vpm-auth-float__input--error {
  border-color: #ef4444;
}

.vpm-auth-float__label {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--vpm-auth-muted);
  background: var(--vpm-auth-card);
  pointer-events: none;
  transition: top 200ms ease, transform 200ms ease, font-size 200ms ease, color 200ms ease;
}

.vpm-auth-float__input:focus + .vpm-auth-float__label,
.vpm-auth-float__input:not(:placeholder-shown) + .vpm-auth-float__label {
  top: 0;
  transform: translateY(-50%) scale(0.85);
  font-size: 12px;
  color: var(--vpm-auth-primary);
}

/* Select variant: a native dropdown always holds a value, so keep the label
   floated and add a caret. */
.vpm-auth-float__input--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' 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: right 12px center;
}

.vpm-auth-float__label--fixed {
  top: 0;
  transform: translateY(-50%) scale(0.85);
  font-size: 12px;
}

.vpm-auth-float__input--select:focus + .vpm-auth-float__label--fixed {
  color: var(--vpm-auth-primary);
}

.vpm-auth-float__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--vpm-auth-muted);
}

.vpm-auth-float__error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #ef4444;
}

.vpm-auth-ref__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--vpm-auth-primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: background 150ms ease;
}

.vpm-auth-ref__submit:hover {
  background: var(--vpm-auth-primary-hover);
}

.vpm-auth-ref__submit:focus-visible {
  outline: 2px solid var(--vpm-auth-primary);
  outline-offset: 2px;
}

.vpm-auth-ref__submit:disabled,
.vpm-auth-ref__submit[aria-busy='true'] {
  opacity: 0.6;
  cursor: not-allowed;
}

.vpm-auth-ref__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--vpm-auth-primary);
  text-decoration: none;
}

.vpm-auth-ref__link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vpm-auth-ref__footer {
  margin: 0;
  font-size: 14px;
  color: var(--vpm-auth-muted);
  text-align: center;
}

.vpm-auth-ref .vpm-flash-stack {
  width: 100%;
  margin-bottom: 0;
}

.vpm-auth-ref .vpm-alert {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.vpm-auth-ref .vpm-alert--error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.vpm-auth-ref .vpm-alert--success {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .vpm-auth-float__label,
  .vpm-auth-ref__submit {
    transition: none;
  }
}
