/* FLUX FINANCE — fiesta auth (login / register) */

:root {
  --auth-font: "DM Sans", "Plus Jakarta Sans", system-ui, sans-serif;
  --auth-display: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --auth-ink: #1c1917;
  --auth-muted: #78716c;
  --auth-line: #e7e5e4;
  --auth-soft: #fffbeb;
  --auth-field-bg: #ffffff;
  --auth-blue: #2563eb;
  --auth-blue-deep: #1d4ed8;
  --auth-radius: 14px;
  --auth-field-h: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Full viewport + scroll (register must not clip on small screens) */
body.tff-page--flux-auth.tff-page--fiesta .tff-phone,
body.tff-page--flux-auth.tff-page--fiesta .tff-stage,
body.tff-page--flux-auth.tff-page--fiesta #haAppMain {
  box-sizing: border-box;
  min-height: 100dvh;
  min-height: 100svh;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.flux-auth-screen.fiesta-page--auth {
  width: 100%;
  max-width: min(440px, 100%);
  margin: 0 auto;
}

/* Hero inside rainbow frame */
.flux-auth-hero {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 16px;
}

.flux-auth-hero--compact {
  margin-bottom: 12px;
}

.flux-auth-hero--compact .flux-auth-hero__logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  margin-bottom: 10px;
}

.flux-auth-hero__logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.15);
}

.flux-auth-hero__brand {
  margin: 0 0 8px;
  font-family: var(--auth-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--auth-ink);
}

.flux-auth-hero__brand span {
  color: var(--auth-blue);
  letter-spacing: clamp(0.08em, 2vw, 0.22em);
}

.flux-auth-hero__title {
  margin: 0;
  font-family: var(--auth-display);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--auth-ink);
}

.flux-auth-hero__sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--auth-muted);
}

/* Form */
.tff-form.flux-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: none;
  margin: 0;
  width: 100%;
}

.flux-auth-form__lbl {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.flux-auth-form__opt {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.85;
}

.flux-auth-form .tff-field {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.flux-auth-form__row {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 10px);
  width: 100%;
  min-width: 0;
  min-height: var(--auth-field-h);
  padding: 0 clamp(10px, 3vw, 12px);
  border-radius: var(--auth-radius);
  background: var(--auth-field-bg);
  border: 1.5px solid var(--auth-line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.flux-auth-form .tff-field:focus-within .flux-auth-form__row {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.flux-auth-form__row svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--auth-muted);
  filter: none;
}

.flux-auth-form .tff-dial {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--auth-ink);
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid var(--auth-line);
  text-shadow: none;
}

.flux-auth-form .tff-field input {
  flex: 1;
  min-width: 0;
  height: calc(var(--auth-field-h) - 4px);
  border: 0;
  outline: none;
  background: transparent;
  color: var(--auth-ink);
  font-family: var(--auth-font);
  font-size: max(16px, 15px);
  font-weight: 600;
  text-shadow: none;
}

.flux-auth-form .tff-field input::placeholder {
  color: #a8a29e;
  font-weight: 500;
}

.flux-auth-form .tff-field--password .flux-auth-form__row {
  padding-right: 4px;
}

/* Password eye — one icon visible at a time */
.flux-auth-form .tff-pw-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: none;
}

.flux-auth-form .tff-pw-toggle svg {
  width: 20px;
  height: 20px;
  grid-area: 1 / 1;
}

.flux-auth-form .tff-pw-toggle__off[hidden],
.flux-auth-form .tff-pw-toggle__open[hidden] {
  display: none !important;
}

.flux-auth-form input[type="password"]::-ms-reveal,
.flux-auth-form input[type="password"]::-ms-clear {
  display: none;
}

.flux-auth-form .tff-field input:-webkit-autofill,
.flux-auth-form .tff-field input:-webkit-autofill:hover,
.flux-auth-form .tff-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-ink);
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0 1000px var(--auth-field-bg) inset;
}

.flux-auth-form__submit,
body.tff-page--flux-auth .tff-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--auth-radius);
  cursor: pointer;
  font-family: var(--auth-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff !important;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    120deg,
    #e11d48,
    #ea580c,
    #f59e0b,
    #0284c7,
    #7c3aed
  ) !important;
  background-size: 200% 100% !important;
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.28) !important;
  text-shadow: none !important;
}

body.tff-page--flux-auth .tff-btn:active {
  transform: translateY(1px);
}

.flux-auth-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--auth-muted);
}

.flux-auth-foot__link {
  color: #db2777;
  font-weight: 800;
  text-decoration: none;
  margin-left: 4px;
}

.flux-auth-foot__link:hover {
  text-decoration: underline;
}

.flux-auth-form .hp-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 380px) {
  :root { --auth-field-h: 46px; }
  .flux-auth-form { gap: 10px; }
  .flux-auth-hero__brand { font-size: 11px; letter-spacing: 0.1em; }
  .flux-auth-form .tff-dial { font-size: 13px; padding-right: 8px; }
  .flux-auth-form__row svg { width: 16px; height: 16px; }
}

@media (max-width: 320px) {
  :root { --auth-field-h: 44px; }
  .flux-auth-hero__title { font-size: 20px; }
  .flux-auth-form .tff-pw-toggle { width: 36px; height: 36px; }
}

@media (max-height: 680px) {
  .flux-auth-hero { margin-bottom: 10px; }
  .flux-auth-hero__sub { font-size: 12px; }
  .flux-auth-hero__logo { width: 72px; height: 72px; }
  .flux-auth-form { gap: 9px; }
  body.tff-page--login .fiesta-page--auth .flux-auth-frame {
    margin-top: 0;
    margin-bottom: 0;
  }
}

@media (max-height: 580px) {
  .flux-auth-hero--compact .flux-auth-hero__logo,
  .flux-auth-hero__logo {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }
  .flux-auth-hero__sub { display: none; }
  .fiesta-page--auth .fiesta-bunting { margin-bottom: 6px; }
  .fiesta-page--auth .fiesta-head { margin-bottom: 6px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .fiesta-page--auth .fiesta-bunting { display: none; }
  .flux-auth-hero { margin-bottom: 8px; }
  .flux-auth-hero__logo { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .flux-auth-form__row,
  .tff-btn {
    transition: none;
  }
}
