/* Login dynamic widgets.
   Single source of truth for weather and economic indicators. */

.login-showcase {
  row-gap: 14px;
}

/* Los widgets móviles no deben participar en la grilla de escritorio. */
.login-clima-mobile,
.login-indicadores-mobile {
  display: none;
}

.login-clima {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  width: min(100%, 620px);
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(67, 153, 211, .08));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  backdrop-filter: blur(12px);
}

.login-clima[hidden],
.login-indicadores[hidden],
.login-clima-mobile[hidden],
.login-indicadores-mobile[hidden] {
  display: none;
}

.login-clima .lc-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  font-size: 21px;
}

.login-clima .lc-reading,
.login-clima .lc-copy,
.login-indicadores .li-copy {
  display: grid;
  min-width: 0;
}

.login-clima .lc-reading { line-height: 1; }
.login-clima .lc-temp { color: #fff; font-size: 28px; font-weight: 950; letter-spacing: -.02em; }
.login-clima .lc-reading small { margin-top: 3px; color: rgba(255, 255, 255, .48); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.login-clima .lc-copy { gap: 3px; }
.login-clima .lc-copy strong { overflow: hidden; color: #fff; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.login-clima .lc-copy span { color: rgba(215, 237, 255, .65); font-size: 9px; font-weight: 700; }
.login-clima .lc-stats { display: flex; gap: 5px; }
.login-clima .lc-stats span { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; padding: 5px 8px; border-radius: 9px; background: rgba(3, 18, 38, .25); color: rgba(235, 247, 255, .85); font-size: 8.5px; font-weight: 800; white-space: nowrap; }
.login-clima .lc-stats b { font-size: 11px; }

.login-indicadores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.login-indicadores .li-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
}

.login-indicadores .li-icon,
.login-indicadores-mobile .li-icon {
  display: grid;
  place-items: center;
  background: rgba(82, 177, 232, .16);
  color: #a9ddff;
  font-weight: 950;
}

.login-indicadores .li-icon { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.login-indicadores .li-key { color: rgba(255, 255, 255, .48); font-size: 8px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.login-indicadores .li-val { overflow: hidden; color: #fff; font-size: 13px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
.login-indicadores .li-copy small { color: rgba(255, 255, 255, .42); font-size: 7.5px; font-weight: 700; }

@media (max-width: 768px) {
  .login-mobile-header { order: 1; }
  .login-card { order: 2; }
  .login-indicadores-mobile { order: 3; }

  .login-clima-mobile {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 13px;
    background: rgba(255, 255, 255, .09);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
  }

  .login-clima-mobile .lc-icon { font-size: 18px; }
  .login-clima-mobile .lc-temp { color: #fff; font-size: 18px; font-weight: 950; }
  .login-clima-mobile .lc-mobile-right { display: grid; gap: 1px; min-width: 0; }
  .login-clima-mobile .lc-desc { overflow: hidden; color: rgba(235, 247, 255, .88); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
  .login-clima-mobile .lc-loc { color: rgba(205, 231, 250, .55); font-size: 8px; font-weight: 700; white-space: nowrap; }

  .login-indicadores-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 2px 0 10px;
  }

  .login-indicadores-mobile .li-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px; padding: 7px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 11px; background: rgba(255, 255, 255, .08); box-shadow: 0 8px 20px rgba(0, 0, 0, .1); }
  .login-indicadores-mobile .li-icon { width: 21px; height: 21px; border-radius: 7px; font-size: 9px; }
  .login-indicadores-mobile .li-copy { display: grid; min-width: 0; }
  .login-indicadores-mobile .li-key { color: rgba(255, 255, 255, .48); font-size: 7px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
  .login-indicadores-mobile .li-val { overflow: hidden; color: #fff; font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
  .login-indicadores-mobile .li-copy small { display: none; }
}

.champion-mode-hint {
  margin: 4px 12px 12px;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 9px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
  cursor: default !important;
  pointer-events: none;
}

@media (max-width: 360px) {
  .login-mobile-header > div:nth-child(2) { display: none; }
  .login-clima-mobile { margin-left: 0; }
  .login-indicadores-mobile { gap: 4px; padding-inline: 8px; }
  .login-indicadores-mobile .li-item { padding: 6px 5px; }
  .login-indicadores-mobile .li-icon { display: none; }
  .login-indicadores-mobile .li-val { font-size: 8px; }
}

@media (max-width: 768px) {
  #login-screen.login-screen {
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 100dvh !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    background:
      radial-gradient(circle at 45% 96%, rgba(255, 255, 255, .34) 0 2px, transparent 5px),
      radial-gradient(circle at 76% 11%, rgba(255, 255, 255, .44) 0 2px, transparent 6px),
      linear-gradient(160deg, #07334a 0%, #06435a 42%, #05283c 100%) !important;
  }

  #login-screen .login-mobile-header {
    flex-shrink: 0;
    margin-top: max(16px, env(safe-area-inset-top)) !important;
    margin-bottom: 10px !important;
  }

  #login-screen .login-card {
    flex-shrink: 0;
    margin: 0 auto !important;
  }

  #login-indicadores-mobile:not([hidden]) {
    display: grid !important;
    flex-shrink: 0;
    margin-top: 10px !important;
    margin-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 640px) {
  #register-form.login-card {
    width: min(100%, calc(100vw - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
    overflow: hidden !important;
  }

  #register-form .login-card-head {
    padding: 22px 18px 16px !important;
  }

  #register-form #reg-fields-area {
    padding: 18px 18px 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #register-form #reg-fields-area > div[style*="grid-template-columns:1fr 1fr"],
  #register-form #reg-fields-area > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #register-form .reg-lbl,
  #register-form .reg-lbl input,
  #register-form .reg-lbl select,
  #register-form .phone-combo input,
  #register-form .country-picker-button {
    min-width: 0 !important;
  }

  #register-form .reg-lbl input,
  #register-form .reg-lbl select,
  #register-form .phone-combo input,
  #register-form .country-picker-button {
    height: 46px !important;
    min-height: 46px !important;
    font-size: 16px !important;
  }

  #register-form .phone-combo {
    display: grid !important;
    grid-template-columns: minmax(104px, 34%) minmax(0, 1fr) !important;
    align-items: end !important;
    gap: 8px !important;
  }

  #register-form #reg-footer {
    padding: 12px 18px max(14px, env(safe-area-inset-bottom)) !important;
    background: rgba(248, 252, 255, .96) !important;
  }
}
#register-form.register-card {
  display: none;
  max-height: min(780px, calc(100dvh - 24px));
  overflow: hidden;
  flex-direction: column;
}

.reg-lbl {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted, #6b7280);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.reg-lbl input,
.reg-lbl select {
  margin-top: 1px;
  padding: 7px 10px;
  font-size: 13px;
}

#pw-hints {
  display: none;
  margin-top: 6px;
  padding: 10px 13px;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  background: linear-gradient(135deg, #fffbeb, #fef9ee);
}

#pw-hints p {
  margin: 0 0 6px;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

#pw-hints li {
  padding: 2px 0;
  color: #d97706;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
  transition: all .25s;
}

#pw-hints li.ok {
  color: #15803d;
  font-weight: 800;
}

.login-modules-strip {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.login-module-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.login-module-icon {
  font-size: 18px;
}

.login-module-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.login-provider-btn {
  display: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.login-provider-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-login-btn {
  border: 2px solid #4285f4;
  background: #fff;
  color: #3c4043;
  box-shadow: 0 2px 8px rgba(66, 133, 244, .18);
}

.google-login-btn:hover {
  background: #f0f6ff;
  box-shadow: 0 4px 14px rgba(66, 133, 244, .32);
}

.login-separator {
  display: none;
  align-items: center;
  gap: 10px;
}

.login-separator span:first-child,
.login-separator span:last-child {
  flex: 1;
  height: 1px;
  background: #d1d5db;
}

.login-separator span:nth-child(2) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}

.local-login-toggle-btn {
  border: 2px solid #d1d5db;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.local-login-toggle-btn:hover {
  border-color: #9ca3af;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.local-login-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-text-back {
  display: none;
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.google-login-hint {
  display: none;
}

.register-toggle-btn {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid #2563eb;
  border-radius: 20px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1px;
  transition: background .15s, box-shadow .15s;
}

.register-toggle-btn:hover {
  background: #dbeafe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .18);
}

.register-card-head {
  flex-shrink: 0;
}

.register-welcome {
  margin-top: 4px;
}

.register-welcome h1 {
  margin-bottom: 3px;
  font-size: 18px;
}

.register-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.reg-method-choice {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
}

.reg-method-title {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.reg-method-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.reg-method-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}

.reg-method-card:hover {
  background: var(--wash);
}

.reg-method-card.is-google {
  border: 2px solid #4285f4;
}

.reg-method-icon {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--wash);
  font-size: 20px;
}

.reg-method-icon.is-google {
  background: #e8f0fe;
  font-size: initial;
}

.reg-method-copy {
  flex: 1;
  min-width: 0;
}

.reg-method-copy span {
  display: block;
}

.reg-method-copy span:first-child {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.reg-method-copy span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.reg-method-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
}

.reg-method-arrow {
  color: var(--muted);
  font-size: 18px;
}

.reg-back-login {
  width: 100%;
  margin-top: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}

.reg-back-login span {
  color: #2563eb;
  font-weight: 700;
}

.is-hidden {
  display: none;
}

.register-google-info {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 12px 22px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.register-google-avatar {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.register-google-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.register-google-copy strong {
  font-size: 13px;
}

.register-google-copy span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.register-google-copy small {
  color: var(--muted);
  font-size: 11px;
}

.reg-fields-area {
  flex: 1;
  min-height: 0;
  gap: 8px;
  overflow-y: auto;
}

.reg-back-method {
  margin-bottom: 4px;
}

.reg-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reg-rut-wrap {
  position: relative;
}

.reg-rut-input {
  width: 100%;
  padding-right: 36px;
}

.reg-rut-status {
  position: absolute;
  top: 50%;
  right: 9px;
  font-size: 15px;
  pointer-events: none;
  transform: translateY(-50%);
}

.reg-rut-hint {
  min-height: 14px;
  margin-top: 2px;
  color: #ef4444;
  font-size: 11px;
}

.reg-foreign-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}

.reg-foreign-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--blue);
}

.pw-hints-list {
  margin: 0;
  padding: 0;
}

.register-error {
  margin: 0;
}

.reg-footer {
  display: grid;
  flex-shrink: 0;
  gap: 8px;
  padding: 14px 26px 16px;
  border-top: 1px solid var(--line);
}

.register-submit {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 2px 8px rgba(29, 78, 216, .25);
}

.login-toggle-link {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.forgot-pw-modal {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.forgot-pw-form {
  margin: 0;
}

.forgot-pw-head {
  padding: 18px 22px;
  border-radius: 16px 16px 0 0;
  background: var(--green);
  color: #fff;
}

.forgot-pw-head h2 {
  margin: 0;
  font-size: 18px;
}

.forgot-pw-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

.forgot-pw-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.forgot-pw-body strong {
  color: var(--ink);
}

.forgot-pw-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.forgot-pw-input {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--wash);
  color: var(--ink);
  font-size: 14px;
}

.forgot-pw-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.forgot-pw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.forgot-pw-cancel {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.forgot-pw-submit {
  padding: 9px 22px;
}

.auth-flow-dialog {
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}

.auth-flow-dialog-sm {
  width: 90%;
  max-width: 400px;
}

.auth-flow-dialog-md {
  width: 92%;
  max-width: 440px;
}

.auth-flow-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-flow-head {
  padding: 20px 24px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, var(--sidebar-bg), var(--green));
  color: #fff;
}

.auth-flow-head h2 {
  margin: 0;
  font-size: 18px;
}

.auth-flow-head p {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: .85;
}

.auth-flow-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 0 0 16px 16px;
  background: #fff;
}

.auth-flow-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.auth-flow-error {
  min-height: 18px;
  margin: 0;
  color: #dc2626;
  font-size: 13px;
}

.auth-flow-submit {
  width: 100%;
}

.auth-flow-muted {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.force-pw-strength-wrap {
  display: none;
  margin-top: -8px;
}

.force-pw-strength-bars {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.force-pw-strength-bars > div {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #e5e9ee;
  transition: background .2s;
}

.force-pw-rules {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.change-pw-dialog {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.change-pw-form {
  margin: 0;
}

.change-pw-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.change-pw-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.change-pw-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

.change-pw-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.change-pw-input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  color: var(--ink);
  font-size: 14px;
}

.change-pw-strength {
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.change-pw-strength > div {
  width: 0;
  height: 100%;
  border-radius: 4px;
  transition: width .25s, background-color .25s;
}

.change-pw-strength-label {
  display: block;
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.change-pw-status {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.change-pw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.change-pw-cancel,
.change-pw-close-others,
.change-pw-submit {
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.change-pw-cancel {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.change-pw-close-others {
  display: none;
  border: 1px solid var(--green);
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.change-pw-submit {
  padding-right: 22px;
  padding-left: 22px;
  font-weight: 800;
}
