/* Autenticação dos produtos — arquitetura visual compartilhada. */
.auth-product-page {
  --auth-header-height: 64px;
  --auth-footer-height: 72px;
  --auth-page-max: 1920px;
  --auth-card-width: 540px;
  --auth-wallpaper-image: none;
  --auth-wallpaper-position: center center;
  --auth-wallpaper-mobile-position: center center;
  --auth-wallpaper-fallback: var(--bg-secondary);
  --auth-wallpaper-overlay: linear-gradient(90deg, color-mix(in srgb, var(--bg-primary) 24%, transparent), transparent 62%, color-mix(in srgb, var(--bg-primary) 34%, transparent));
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  color: var(--text-primary);
  background: var(--bg-primary);
  font-family: var(--font-ui);
}

.auth-product-page *,
.auth-product-page *::before,
.auth-product-page *::after { box-sizing: border-box; }

.auth-product-shell {
  width: min(100%, var(--auth-page-max));
  min-height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: var(--auth-header-height) minmax(0, 1fr) var(--auth-footer-height);
  color: var(--text-primary);
  background: var(--bg-primary);
}

.auth-product-header,
.auth-product-footer {
  position: relative;
  z-index: 20;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(28px, 3.8vw, 64px);
  background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
  backdrop-filter: blur(14px);
}

.auth-product-header { border-bottom: 1px solid var(--border-primary); }
.auth-product-header { height: var(--auth-header-height); min-height: var(--auth-header-height); padding-block: 0; }
.auth-product-footer { border-top: 1px solid var(--border-primary); }

.auth-product-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}

.auth-product-brand--image { width: clamp(150px, 11vw, 188px); height: 42px; }
.auth-product-logo { width: 100%; height: 100%; display: block; object-fit: contain; object-position: left center; }
.auth-product-logo--dark,
.auth-product-logo--reading { display: none; }
[data-theme="dark"] .auth-product-logo--dark { display: block; }
[data-theme="dark"] .auth-product-logo--light { display: none; }
[data-theme="reading"] .auth-product-logo--reading { display: block; }
[data-theme="reading"] .auth-product-logo--light { display: none; }

.auth-product-brand--text,
.auth-product-card__brand--text {
  font-family: var(--font-brand);
  font-weight: var(--weight-medium);
  letter-spacing: .24em;
  line-height: 1;
}
.auth-product-brand--text { font-size: clamp(1.38rem, 1.65vw, 1.8rem); }
.auth-product-brand--text span,
.auth-product-card__brand--text span,
.auth-product-footer strong span { color: var(--brand-accent); }

.auth-product-header__actions { display: flex; align-items: center; gap: 18px; }
.auth-product-switch {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 72%, var(--border-primary));
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.auth-product-switch:hover,
.auth-product-switch:focus-visible {
  color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 8%, transparent);
  border-color: var(--brand-accent);
  transform: translateY(-1px);
}
.auth-product-switch__short { display: none; }

.auth-product-theme {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.auth-product-theme:hover,
.auth-product-theme:focus-visible {
  color: var(--brand-accent);
  background: var(--surface-elevated);
  border-color: var(--brand-accent);
  transform: rotate(7deg);
}
.auth-product-theme svg { width: 18px; height: 18px; }

.auth-product-main {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(500px, .95fr);
  background-color: var(--auth-wallpaper-fallback);
  background-image: var(--auth-wallpaper-overlay), var(--auth-wallpaper-image);
  background-position: center, var(--auth-wallpaper-position);
  background-repeat: no-repeat;
  background-size: cover;
}

.auth-product-hero {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 620px;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(54px, 7vw, 100px);
  background: transparent;
  border: 0;
}

.auth-product-page--marketplace {
  --auth-wallpaper-image: url("../assets/brand/closetfy/pwa/closetfy-pwa-desktop.png");
  --auth-wallpaper-position: center center;
  --auth-wallpaper-mobile-position: center center;
  --auth-wallpaper-fallback: var(--bg-secondary);
}
[data-theme="dark"] .auth-product-page--marketplace,
.auth-product-page--marketplace[data-theme="dark"] {
  --auth-wallpaper-image: url("../assets/brand/closetfy/pwa/closetfy-pwa-desktop.png");
  --auth-wallpaper-overlay: linear-gradient(90deg, color-mix(in srgb, var(--bg-primary) 32%, transparent), transparent 64%, color-mix(in srgb, var(--bg-primary) 42%, transparent));
}

@media (max-width: 700px) {
  .auth-product-page--marketplace { --auth-wallpaper-image: url("../assets/brand/closetfy/pwa/closetfy-pwa-mobile.png"); }
}

.auth-product-page--control {
  --auth-wallpaper-image: radial-gradient(circle at 18% 26%,color-mix(in srgb,var(--brand-accent) 16%,transparent),transparent 42%),linear-gradient(132deg,var(--bg-tertiary),var(--bg-primary) 62%);
  --auth-wallpaper-position: 47% center;
  --auth-wallpaper-mobile-position: 42% 48%;
  --auth-wallpaper-fallback: var(--bg-secondary);
}
html[data-gestao-theme="dark"] .auth-product-page--control,
.auth-product-page--control[data-theme="dark"] {
  --auth-wallpaper-image: radial-gradient(circle at 18% 26%,color-mix(in srgb,var(--brand-accent) 23%,transparent),transparent 42%),linear-gradient(132deg,var(--bg-tertiary),var(--bg-primary) 62%);
  --auth-wallpaper-overlay: linear-gradient(90deg, color-mix(in srgb, var(--bg-primary) 28%, transparent), transparent 66%, color-mix(in srgb, var(--bg-primary) 44%, transparent));
}

.auth-product-hero__copy { position: relative; z-index: 2; width: min(100%, 650px); }
.auth-product-hero__copy h2 {
  max-width: 12ch;
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-editorial);
  font-size: clamp(4rem, 6vw, 6.35rem);
  font-weight: var(--weight-regular);
  letter-spacing: -.04em;
  line-height: .82;
}
.auth-product-hero__copy h2 em { color: var(--brand-accent); font-style: normal; }
.auth-product-hero__rule { width: 56px; height: 2px; display: block; margin: 34px 0 24px; background: var(--brand-accent); }
.auth-product-hero__copy p { margin: 0; color: var(--text-secondary); font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.48; }

.auth-product-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(28px, 4vw, 64px);
  background: transparent;
}
.auth-product-stage::before { content: none; }

.auth-product-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--auth-card-width);
  justify-self: center;
  min-width: 0;
  padding: clamp(34px, 3.4vw, 52px);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-primary) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 38%, var(--border-primary));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  backdrop-filter: blur(20px) saturate(108%);
}

.auth-product-card__brand {
  width: 180px;
  height: 48px;
  margin: 0 auto 25px;
  color: var(--text-primary);
}
.auth-product-card__brand--text {
  width: auto;
  height: auto;
  margin-bottom: 30px;
  font-size: 1.48rem;
  text-align: center;
}

.auth-product-intro { margin: 0 0 28px; text-align: center; }
.auth-product-title {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-editorial);
  font-size: clamp(2.4rem, 3vw, 3.35rem);
  font-weight: var(--weight-medium);
  letter-spacing: -.035em;
  line-height: 1;
}
.auth-product-subtitle { margin: 12px 0 0; color: var(--text-secondary); font-size: .93rem; line-height: 1.5; }

.auth-product-form { display: grid; gap: 16px; }
.auth-product-field { position: relative; min-width: 0; display: grid; gap: 5px; }
.auth-product-password { position: relative; min-width: 0; display: flex; align-items: center; }
.auth-product-field__icon {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--icon-secondary);
  pointer-events: none;
  transform: translateY(-50%);
}
.auth-product-field > .auth-product-field__icon { top: 27px; }
.auth-product-field__icon svg { width: 20px; height: 20px; }

.auth-product-page .auth-product-input,
.auth-product-page .auth-product-field .auth-product-input {
  width: 100%;
  min-width: 0;
  min-height: 54px !important;
  padding: 12px 52px !important;
  color: var(--text-primary) !important;
  caret-color: var(--brand-accent);
  background: color-mix(in srgb, var(--surface-secondary) 88%, transparent) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  font: var(--weight-regular) 16px/1.4 var(--font-ui) !important;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.auth-product-page .auth-product-input::placeholder { color: var(--text-secondary); opacity: 1; }
.auth-product-page .auth-product-input:hover { border-color: color-mix(in srgb, var(--text-secondary) 48%, var(--border-primary)) !important; }
.auth-product-page .auth-product-input:focus { background: var(--surface-primary) !important; border-color: var(--brand-accent) !important; box-shadow: var(--focus-ring) !important; }
.auth-product-page .auth-product-input[aria-invalid="true"] { border-color: var(--danger) !important; }
.auth-product-field:focus-within .auth-product-field__icon { color: var(--brand-accent); }

.auth-product-password > button,
.auth-product-page #toggle-senha,
.auth-product-page #gestao-show-password {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 7px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--icon-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transform: translateY(-50%);
}
.auth-product-password > button:hover,
.auth-product-password > button:focus-visible { color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 9%, transparent); }

.auth-product-form__options { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.auth-product-remember { display: inline-flex; align-items: center; gap: 9px; color: var(--text-secondary); font-size: var(--font-sm); cursor: pointer; }
.auth-product-remember input { width: 19px; height: 19px; margin: 0; accent-color: var(--brand-accent); }
.auth-product-session-note { display:inline-flex; align-items:center; min-height:34px; color:var(--text-secondary); font-size:var(--font-sm); }
.auth-product-forgot,
.auth-product-card__footer a { color: var(--brand-accent); font-size: var(--font-sm); font-weight: var(--weight-medium); text-underline-offset: 3px; }
.auth-product-forgot { min-height: 34px; display: inline-flex; align-items: center; }

.auth-product-submit,
.auth-product-page .auth-product-submit {
  width: 100%;
  min-height: 54px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 1px 0 0;
  padding: 11px 20px;
  color: var(--on-accent) !important;
  background: linear-gradient(105deg, color-mix(in srgb, var(--brand-accent) 82%, var(--surface-primary)), var(--brand-accent)) !important;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 88%, var(--border-primary)) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-accent) 17%, transparent) !important;
  font: var(--weight-semibold) .93rem/1 var(--font-ui);
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}
.auth-product-submit:hover:not(:disabled),
.auth-product-submit:focus-visible:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-accent) 24%, transparent) !important; }
.auth-product-submit:disabled { opacity: .62; cursor: wait; transform: none; }

.auth-product-divider { margin: 22px 0; display: flex; align-items: center; gap: 18px; color: var(--text-muted); font-size: var(--font-sm); }
.auth-product-divider::before,
.auth-product-divider::after { content: ""; height: 1px; flex: 1; background: var(--border-primary); }

.auth-product-social,
.auth-product-page .auth-product-social {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 10px 18px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-secondary) 72%, transparent);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: none;
  font: var(--weight-medium) .9rem/1 var(--font-ui);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.auth-product-social:hover:not(:disabled),
.auth-product-social:focus-visible:not(:disabled) { color: var(--brand-accent); background: var(--surface-secondary); border-color: var(--brand-accent); }
.auth-product-social:disabled { opacity: .62; cursor: wait; }

.auth-product-card__footer { margin: 23px 0 0; color: var(--text-secondary); font-size: var(--font-sm); line-height: 1.5; text-align: center; }
.auth-product-login-extras[hidden] { display: none; }
.auth-product-page .gestao-field-error { min-height: 0; margin: 0; font-size: .76rem; line-height: 1.3; }
.auth-product-page .gestao-field-error:empty { display: none; }
.auth-product-page .gestao-form-alert { margin: 0; }
.gestao-app.auth-product-page .auth-product-title { color: var(--text-primary); font-family: var(--font-editorial); font-size: clamp(2.4rem, 3vw, 3.35rem); font-weight: var(--weight-medium); letter-spacing: -.035em; line-height: 1; }
.gestao-app.auth-product-page .auth-product-subtitle { color: var(--text-secondary); font-size: .93rem; }
.gestao-app.auth-product-page .auth-product-remember { color: var(--text-secondary); font-size: var(--font-sm); font-weight: var(--weight-regular); letter-spacing: 0; text-transform: none; }

.auth-product-page .gestao-first-access-notice { border-color: color-mix(in srgb, var(--brand-accent) 34%, var(--border-primary)); background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.auth-product-page .gestao-first-access-notice > span { color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 13%, transparent); }
.auth-product-page .gestao-first-access label { color: var(--text-secondary); font-size: .72rem; font-weight: var(--weight-semibold); }
.auth-product-page .gestao-first-access small { color: var(--text-muted); }

.auth-product-footer { color: var(--text-secondary); font-size: var(--font-xs); }
.auth-product-footer p { display: flex; align-items: center; gap: 16px; margin: 0; }
.auth-product-footer strong { color: var(--text-primary); font-family: var(--font-brand); font-size: 1rem; font-weight: var(--weight-medium); letter-spacing: .22em; }
.auth-product-footer p i { width: 1px; height: 20px; display: block; background: var(--border-primary); }
.auth-product-footer nav { display: flex; align-items: center; gap: clamp(22px, 3vw, 42px); }
.auth-product-footer a { min-height: 36px; display: inline-flex; align-items: center; color: var(--text-secondary); text-decoration: none; }
.auth-product-footer a:hover,
.auth-product-footer a:focus-visible { color: var(--brand-accent); }

.auth-product-page input:-webkit-autofill,
.auth-product-page input:-webkit-autofill:hover,
.auth-product-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--brand-accent);
  box-shadow: 0 0 0 1000px var(--surface-secondary) inset !important;
  transition: background-color 9999s ease-out 0s;
}

@media (max-width: 1180px) {
  .auth-product-main { grid-template-columns: minmax(0, 1.2fr) minmax(470px, .8fr); }
  .auth-product-hero { padding-inline: clamp(46px, 5vw, 68px); }
  .auth-product-hero__copy h2 { font-size: clamp(3.6rem, 6.5vw, 5.2rem); }
  .auth-product-stage { padding-inline: clamp(24px, 3vw, 42px); }
}

@media (max-width: 1024px) {
  .auth-product-page { --auth-header-height: 68px; --auth-footer-height: 64px; }
  .auth-product-main {
    grid-template-columns: minmax(0, 1fr);
    background-position: center, var(--auth-wallpaper-mobile-position);
  }
  .auth-product-hero { display: none; }
  .auth-product-stage { min-height: calc(100dvh - var(--auth-header-height) - var(--auth-footer-height)); padding: clamp(38px, 7vh, 72px) clamp(24px, 8vw, 72px); }
  .auth-product-card { width: 100%; max-width: 540px; }
}

@media (max-width: 599px) {
  .auth-product-page { --auth-header-height: 64px; --auth-footer-height: auto; }
  .auth-product-shell { grid-template-rows: var(--auth-header-height) minmax(0, 1fr) auto; }
  .auth-product-header { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .auth-product-brand--image { width: 126px; height: 36px; }
  .auth-product-brand--text { font-size: 1.18rem; letter-spacing: .2em; }
  .auth-product-header__actions { gap: 8px; }
  .auth-product-switch { min-height: 38px; padding-inline: 12px; font-size: .75rem; }
  .auth-product-switch__full { display: none; }
  .auth-product-switch__short { display: inline; }
  .auth-product-theme { width: 40px; height: 40px; flex-basis: 40px; }
  .auth-product-stage { min-height: calc(100dvh - var(--auth-header-height)); align-items: start; padding: clamp(24px, 5vh, 42px) max(18px, env(safe-area-inset-right)) max(32px, calc(22px + env(safe-area-inset-bottom))) max(18px, env(safe-area-inset-left)); }
  .auth-product-card { padding: clamp(24px, 7vw, 34px); }
  .auth-product-card__brand { width: 142px; height: 40px; margin-bottom: 20px; }
  .auth-product-card__brand--text { width: auto; height: auto; margin-bottom: 22px; font-size: 1.2rem; }
  .auth-product-intro { margin-bottom: 23px; }
  .auth-product-title { font-size: clamp(2.1rem, 10vw, 2.65rem); }
  .auth-product-subtitle { margin-top: 9px; font-size: .86rem; }
  .auth-product-form { gap: 14px; }
  .auth-product-page .auth-product-input,
  .auth-product-page .auth-product-field .auth-product-input { min-height: 52px !important; }
  .auth-product-form__options { gap: 10px; }
  .auth-product-remember,
  .auth-product-forgot { font-size: .76rem; }
  .auth-product-submit,
  .auth-product-page .auth-product-submit { min-height: 52px !important; }
  .auth-product-divider { margin-block: 19px; }
  .auth-product-card__footer { margin-top: 20px; }
  .auth-product-footer { min-height: 62px; padding: 12px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); justify-content: center; }
  .auth-product-footer p { display: none; }
  .auth-product-footer nav { width: 100%; justify-content: space-between; gap: 10px; }
}

@media (max-width: 359px) {
  .auth-product-switch { padding-inline: 9px; }
  .auth-product-stage { padding-inline: 15px; }
  .auth-product-form__options { align-items: flex-start; }
  .auth-product-remember { padding-top: 7px; }
  .auth-product-forgot { max-width: 124px; text-align: right; }
}

@media (min-width: 1025px) and (max-height: 800px) {
  .auth-product-shell { min-height: 720px; }
  .auth-product-hero { min-height: 584px; }
  .auth-product-card { padding-block: 32px; }
  .auth-product-card__brand { margin-bottom: 17px; }
  .auth-product-card__brand--text { margin-bottom: 22px; }
  .auth-product-intro { margin-bottom: 21px; }
  .auth-product-form { gap: 13px; }
  .auth-product-divider { margin-block: 17px; }
  .auth-product-card__footer { margin-top: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-product-page *,
  .auth-product-page *::before,
  .auth-product-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
