/* Hub Kronzen — login sólido, legible, sin degradados */

.hub-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--tx);
  position: relative;
}

.hub-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(980px, 100%);
  min-height: min(580px, calc(100dvh - 100px));
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--bd);
  background: var(--bg2);
  box-shadow: var(--shadow-md);
  animation: hubIn var(--duration-medium) var(--ease-out) both;
}

@keyframes hubIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Panel izquierdo — misma superficie que el formulario */
.login-showcase {
  flex: 1.08;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 44px 40px;
  background: var(--bg2);
  border-right: 1px solid var(--bd);
}

.login-showcase-bg { display: none; }

.login-showcase-content { position: relative; z-index: 1; max-width: 360px; }

.login-showcase-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--acc);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.login-showcase-badge img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.login-showcase-title {
  font-size: clamp(1.65rem, 2.8vw, 2rem);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--tx);
  text-wrap: balance;
}

.login-showcase-lead {
  font-size: 15px;
  color: var(--tx2);
  margin: 0 0 28px;
  line-height: 1.55;
  max-width: 32ch;
}

.login-showcase-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-showcase-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--tx2);
}

.login-showcase-features li i {
  font-size: 20px;
  color: var(--acc);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--bd);
}

.login-panel {
  flex: 0.92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 32px;
  background: var(--bg2);
}

.hub-box { width: 100%; max-width: 392px; }

.login-head--brand { display: flex; justify-content: center; margin-bottom: 22px; }
.login-wordmark-slot { width: 100%; text-align: center; }
.kronzen-wordmark-img--login {
  max-width: min(220px, 72vw);
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-prefs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd);
}

.login-prefs-row .login-lang-row {
  margin: 0;
  padding: 0;
  border: none;
  flex: 0 0 auto;
  min-width: 0;
}

.hub-box h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--tx);
}

.login-sub {
  font-size: 13px;
  color: var(--tx2);
  margin: 0 0 20px;
  line-height: 1.5;
}

.login-field { margin-bottom: 12px; }
.login-remembered { margin-bottom: 14px; }
.login-remembered[hidden],
#login-user-field[hidden] { display: none !important; }

.login-remembered-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--bd);
  background: var(--bg3);
}

.login-remembered-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--bg4);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  overflow: hidden;
}

.login-remembered-avatar .profile-avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.login-remembered-greet {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-remembered-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-remembered-miss {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.35;
}

.login-remembered-switch {
  display: inline-flex;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accl);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .login-remembered-switch:hover { color: var(--acc); }
}

.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-input-wrap { position: relative; }

.login-input-wrap i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--tx2);
  pointer-events: none;
}

.hub-box input[type="text"],
.hub-box input[type="email"],
.hub-box input[type="password"] {
  width: 100%;
  padding: 11px 12px 11px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bd);
  background: var(--bg3);
  color: var(--tx);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.hub-box input::placeholder {
  color: var(--tx3);
  opacity: 1;
}

.hub-box input[type="text"]:focus,
.hub-box input[type="email"]:focus,
.hub-box input[type="password"]:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: var(--focus-ring);
  background: var(--bg4);
}

/* Chrome autofill: mismo fondo que el resto de campos (no caja blanca/azul) */
.hub-box input:-webkit-autofill,
.hub-box input:-webkit-autofill:hover,
.hub-box input:-webkit-autofill:focus,
.hub-box input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--tx) !important;
  caret-color: var(--tx);
  border: 1px solid var(--bd);
  box-shadow: 0 0 0 1000px var(--bg3) inset !important;
  transition: background-color 99999s ease-out 0s;
}

.hub-box input:read-only {
  background: var(--bg3);
  color: var(--tx2);
  cursor: default;
}

.hub-box label.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tx2);
  margin: 12px 0 16px;
  cursor: pointer;
  min-height: var(--touch-min);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.hub-box {
  color-scheme: dark;
}

body.light .hub-box {
  color-scheme: light;
}

.hub-box input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--acc);
  flex-shrink: 0;
}

.login-turnstile {
  margin: 4px 0 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
  overflow: visible;
  color-scheme: dark;
}

body.light .login-turnstile { color-scheme: light; }
.login-turnstile--ready { min-height: 0; }
.login-turnstile--passed {
  min-height: 0 !important;
  height: 0;
  overflow: hidden;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.login-turnstile:has(iframe) { min-height: 65px; }
.hub-box .login-turnstile,
.hub-box .login-turnstile:has(iframe) {
  min-height: 72px;
  margin: 10px 0 14px;
}
.login-turnstile iframe {
  border: 0 !important;
  background: transparent !important;
  max-width: 100% !important;
}

@media (max-width: 860px), (pointer: coarse) {
  .login-turnstile { min-height: 72px; }
  .login-turnstile:has(iframe) { min-height: 78px; }
}

.login-btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--acc);
  background: var(--acc);
  color: var(--on-acc);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-instant) var(--ease-out);
}

.login-btn-primary,
.login-btn-primary i {
  color: var(--on-acc);
}

@media (hover: hover) and (pointer: fine) {
  .login-btn-primary:hover {
    background: color-mix(in srgb, var(--acc) 88%, var(--tx));
  }
}

.login-btn-primary:active { transform: scale(0.97); }

.login-forgot-wrap { margin-top: 12px; text-align: center; }

.login-forgot-link {
  display: inline-block;
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--acc);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .login-forgot-link:hover { color: var(--accl); }
}

.login-forgot-link:active { transform: scale(0.97); }

.login-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
  text-align: center;
  display: none;
}

.login-footer .lf-company {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 2px;
}

.login-footer .lf-copy {
  font-size: 10px;
  color: var(--tx3);
  margin-bottom: 4px;
}

.login-footer .lf-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.login-footer .lf-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accl);
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
}

.login-err {
  color: var(--red);
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  min-height: 16px;
}

.hint {
  font-size: 12px;
  color: var(--tx2);
  margin: 8px 0 14px;
  line-height: 1.45;
}

.view { display: none; }
.view.active {
  display: block;
  animation: viewIn var(--duration-normal) var(--ease-out) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.theme-switch {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--duration-instant) var(--ease-out);
}

.theme-switch:active { transform: scale(0.97); }

.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 52px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg4);
  border: 1px solid var(--bd);
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.theme-switch.is-light .theme-switch-track {
  background: color-mix(in srgb, var(--amber) 14%, var(--bg3));
  border-color: color-mix(in srgb, var(--amber) 30%, var(--bd));
}

.theme-switch-ico { font-size: 13px; z-index: 1; line-height: 1; }
.theme-switch-ico--dark { color: var(--accl); }
.theme-switch-ico--light { color: var(--amber); opacity: 0.45; }
.theme-switch.is-light .theme-switch-ico--light { opacity: 1; }
.theme-switch.is-light .theme-switch-ico--dark { opacity: 0.35; }

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--bd);
  transition: transform var(--duration-normal) var(--ease-out);
}

.theme-switch.is-light .theme-switch-thumb {
  transform: translateX(22px);
  background: var(--bg);
}

.gt-wrap { position: relative; }

.gt-picker-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--bd);
  background: var(--bg3);
  color: var(--tx2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  max-width: 200px;
  min-height: 36px;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-instant) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .gt-picker-btn:hover { border-color: color-mix(in srgb, var(--acc) 40%, var(--bd)); }
}

.gt-picker-btn:active { transform: scale(0.97); }

.gt-picker-menu {
  position: fixed;
  min-width: 220px;
  max-height: min(280px, 50vh);
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  display: none;
}

.gt-picker-menu.open { display: block; }

.gt-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--tx2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .gt-picker-item:hover { background: var(--bg3); }
}

.gt-picker-item.on { color: var(--accl); font-weight: 600; }
.gt-flag { width: 18px; height: 13px; border-radius: 2px; display: inline-block; background-size: cover; }

.hub-page > .footer {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--tx2);
}

.hub-page > .footer a {
  color: var(--accl);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hub-page > .footer a:hover { color: var(--acc); text-decoration: underline; }
}

@media (max-width: 900px) {
  .login-showcase { display: none; }
  .hub-shell {
    min-height: auto;
    flex-direction: column;
    max-width: 480px;
  }
  .login-panel { padding: 28px 22px 32px; }
}

@media (max-width: 480px) {
  .hub-page { padding: 0; }
  .hub-shell {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .login-panel {
    flex: 1;
    padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  }
  .hub-box input { font-size: 16px; min-height: 48px; }
  .login-btn-primary { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-shell,
  .view.active,
  .login-btn-primary,
  .login-forgot-link,
  .theme-switch,
  .gt-picker-btn {
    animation: none;
    transition: none;
  }
}
