/**
 * IRP Patrimonial - Auth Styles
 * Pantalla de login y avatar de usuario
 */

/* ========================================
   LOGIN SCREEN
   ======================================== */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  background: #10161b;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: auto;
}

.login-screen.visible {
  display: block;
  opacity: 1;
}

.login-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.login-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.82fr);
  background: var(--bg-darker);
  isolation: isolate;
  animation: loginShellIn 0.72s cubic-bezier(.2,.75,.2,1) forwards;
}

@keyframes loginShellIn {
  from { opacity: 0; transform: scale(1.012); }
  to   { opacity: 1; transform: scale(1); }
}

.login-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(44px, 6vw, 84px);
  background:
    linear-gradient(115deg, rgba(11, 17, 22, 0.58) 0%, rgba(21, 27, 32, 0.30) 42%, rgba(250, 92, 0, 0.08) 100%),
    url('../fondo.jpg') center center / cover no-repeat,
    linear-gradient(135deg, #1e272e 0%, #202f36 52%, #151b20 100%);
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(250, 92, 0, 0.32), transparent 24%),
    radial-gradient(circle at 72% 78%, rgba(52, 152, 219, 0.20), transparent 32%),
    linear-gradient(90deg, rgba(10, 15, 19, 0.34), rgba(10, 15, 19, 0.05) 50%, rgba(10, 15, 19, 0.48));
  pointer-events: none;
}

.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.20) 72%, transparent 100%);
  opacity: 0.45;
  pointer-events: none;
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(6, 10, 13, 0.72) 100%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.055) 0 1px, transparent 1px 20px);
  opacity: 0.48;
  pointer-events: none;
}

.login-hero-content {
  position: relative;
  z-index: 3;
  max-width: 760px;
  filter: drop-shadow(0 14px 34px rgba(0,0,0,0.45));
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(21, 27, 32, 0.44);
  color: rgba(236, 240, 241, 0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.login-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 18px rgba(250, 92, 0, 0.95);
}

.login-hero h1 {
  margin: 0;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(58px, 8.2vw, 118px);
  font-weight: 200;
  line-height: 0.88;
  letter-spacing: -4px;
}

.login-hero h1 span {
  color: var(--primary);
  font-weight: 900;
}

.login-hero p {
  margin: 22px 0 0;
  max-width: 620px;
  color: rgba(236, 240, 241, 0.84);
  font-size: clamp(16px, 1.7vw, 21px);
  line-height: 1.55;
}

.login-feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.login-feature-card {
  min-width: 168px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(15, 22, 27, 0.42);
  box-shadow: 0 16px 34px rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
}

.login-feature-card i {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(250, 92, 0, 0.18);
  color: #ffb07f;
  font-size: 13px;
}

.login-feature-card span {
  color: rgba(236, 240, 241, 0.88);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.login-hero-mapline,
.login-hero-orbit {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.login-hero-mapline {
  height: 4px;
  border-radius: 999px;
  transform: rotate(-38deg);
  background: linear-gradient(90deg, transparent, rgba(250, 92, 0, 0.95), rgba(255, 180, 120, 0.5), transparent);
  box-shadow: 0 0 24px rgba(250, 92, 0, 0.18);
}

.login-hero-mapline-a { width: 240px; left: -46px; top: 24%; opacity: 0.78; }
.login-hero-mapline-b { width: 320px; right: 8%; bottom: 28%; opacity: 0.58; }
.login-hero-mapline-c { width: 150px; left: 34%; bottom: 12%; opacity: 0.42; }

.login-hero-orbit {
  border-radius: 50%;
  border: 1px solid rgba(250, 92, 0, 0.22);
  box-shadow: inset 0 0 70px rgba(250, 92, 0, 0.08), 0 0 45px rgba(250, 92, 0, 0.06);
}

.login-hero-orbit-a {
  width: 430px;
  height: 430px;
  right: -160px;
  top: -120px;
}

.login-hero-orbit-b {
  width: 180px;
  height: 180px;
  left: 12%;
  top: 14%;
  border-color: rgba(52, 152, 219, 0.22);
}

.login-card {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(34px, 4vw, 58px);
  background:
    radial-gradient(circle at 18% 8%, rgba(250, 92, 0, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(38, 50, 56, 0.98) 0%, rgba(21, 27, 32, 0.99) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -32px 0 80px rgba(0,0,0,0.42);
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 80%);
  pointer-events: none;
}

.login-card::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(250, 92, 0, 0.72), transparent);
  pointer-events: none;
}

.login-panel-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(32px, 5vh, 52px);
}

.login-logo {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255,255,255,0.96);
  padding: 8px;
  box-shadow: 0 18px 34px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.08);
}

.login-title {
  font-family: 'Roboto', sans-serif;
  font-size: 31px;
  font-weight: 300;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.7px;
  line-height: 1;
}

.login-title span {
  font-weight: 900;
  color: var(--primary);
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 7px 0 0;
  font-weight: 500;
  letter-spacing: 0.25px;
}

.login-welcome-block {
  margin-bottom: 24px;
}

.login-access-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  margin-bottom: 16px;
  border: 1px solid rgba(250, 92, 0, 0.24);
  border-radius: 999px;
  background: rgba(250, 92, 0, 0.10);
  color: #ffbd91;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}

.login-access-label::before {
  content: '\f023';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
}

.login-welcome-block h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: -1.25px;
  line-height: 1.08;
}

.login-welcome-block p {
  margin: 12px 0 0;
  max-width: 390px;
  color: rgba(176, 190, 197, 0.86);
  font-size: 14px;
  line-height: 1.58;
}

#google-signin-btn {
  display: flex;
  justify-content: stretch;
  margin: 0;
  min-height: 48px;
}

#btn-public-access-legacy {
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  border-radius: 15px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  background: rgba(236, 240, 241, 0.96) !important;
  color: #1e272e !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24) !important;
}

#btn-public-access-legacy:hover {
  background: #ffffff !important;
  transform: translateY(-1px);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: rgba(120, 144, 156, 0.92);
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.95px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120, 144, 156, 0.36));
}

.login-divider::after {
  background: linear-gradient(90deg, rgba(120, 144, 156, 0.36), transparent);
}

.local-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.local-login-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  background: rgba(55, 71, 79, 0.66);
  border: 1px solid rgba(120, 144, 156, 0.26);
  border-radius: 15px;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.local-login-field:focus-within {
  border-color: rgba(250, 92, 0, 0.78);
  background: rgba(55, 71, 79, 0.92);
  box-shadow: 0 0 0 4px rgba(250, 92, 0, 0.12), inset 0 1px 0 rgba(255,255,255,0.045);
}

.local-login-field i {
  color: #ffffff;
  font-size: 14px;
  width: 17px;
  text-align: center;
}

.local-login-field input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  padding: 14px 0;
}

.local-login-field input::placeholder {
  color: rgba(176, 190, 197, 0.74);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.local-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  margin-top: 2px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  border-radius: 15px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.35px;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(250, 92, 0, 0.24);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.local-login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 22px 40px rgba(250, 92, 0, 0.32);
}

.local-login-btn:active {
  transform: translateY(0);
}

.local-login-btn i {
  font-size: 13px;
  transition: transform var(--transition-fast);
}

.local-login-btn:hover i {
  transform: translateX(2px);
}

/* Remember me checkbox */
.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  user-select: none;
  margin: 0;
}

.remember-me-label input[type="checkbox"] {
  display: none;
}

.remember-me-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(120, 144, 156, 0.50);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: rgba(21, 27, 32, 0.28);
}

.remember-me-box i {
  font-size: 10px;
  color: transparent;
  transition: color var(--transition-fast);
}

.remember-me-label input:checked + .remember-me-box {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(250, 92, 0, 0.12);
}

.remember-me-label input:checked + .remember-me-box i {
  color: #fff;
}

.remember-me-label:hover .remember-me-box {
  border-color: var(--primary);
}

/* Error message */
.login-error {
  display: none;
  margin-top: 16px;
  padding: 11px 13px;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.34);
  border-radius: 14px;
  color: #ff8a80;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  animation: shakeX 0.5s ease;
}

.login-error small {
  color: var(--text-muted);
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.login-footer {
  margin-top: 30px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.login-footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ========================================
   VERSION TAG en login
   ======================================== */

.login-version {
  position: absolute;
  right: 22px;
  bottom: 18px;
  transform: none;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.48;
  white-space: nowrap;
}


/* Ajuste desktop: alinea visualmente los pills del hero con el cierre del bloque de login */
@media (min-width: 861px) {
  .login-hero-content {
    margin-bottom: clamp(34px, 5vh, 68px);
  }
}

/* ========================================
   RESPONSIVE LOGIN
   ======================================== */

@media (max-width: 1024px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  }

  .login-hero {
    padding: 42px;
  }

  .login-feature-grid {
    gap: 10px;
  }

  .login-feature-card {
    min-width: auto;
  }
}

@media (max-width: 860px) {
  .login-screen {
    overflow: auto;
  }

  .login-shell {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 38vh) auto;
  }

  .login-hero {
    min-height: 260px;
    padding: 32px;
  }

  .login-hero h1 {
    font-size: clamp(44px, 13vw, 68px);
    letter-spacing: -2px;
  }

  .login-hero p {
    max-width: 620px;
    font-size: 15px;
  }

  .login-feature-grid {
    margin-top: 22px;
  }

  .login-card {
    min-height: auto;
    padding: 34px 24px 48px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -24px 70px rgba(0,0,0,0.34);
  }

  .login-card::after {
    left: 0;
    top: -1px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(250, 92, 0, 0.72), transparent);
  }

  .login-panel-inner {
    width: min(100%, 500px);
  }

  .login-card-header {
    margin-bottom: 28px;
  }
}

@media (max-width: 560px) {
  .login-shell {
    grid-template-rows: minmax(220px, 32vh) auto;
  }

  .login-hero {
    min-height: 220px;
    padding: 24px 20px;
  }

  .login-kicker {
    padding: 6px 10px;
    margin-bottom: 14px;
    font-size: 9.5px;
    letter-spacing: 0.55px;
  }

  .login-hero p {
    margin-top: 14px;
    font-size: 13px;
  }

  .login-feature-grid {
    display: none;
  }

  .login-card {
    padding: 28px 18px 44px;
  }

  .login-card-header {
    gap: 12px;
    margin-bottom: 24px;
  }

  .login-logo {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
  }

  .login-title {
    font-size: 28px;
  }

  .login-subtitle {
    font-size: 11px;
  }

  .login-welcome-block h3 {
    font-size: 30px;
  }

  .login-welcome-block p {
    font-size: 13px;
  }

  .login-divider {
    gap: 9px;
    font-size: 9.5px;
  }

  .login-version {
    right: 16px;
    bottom: 12px;
  }
}

@media (max-width: 380px) {
  .login-card-header {
    align-items: flex-start;
  }

  .login-hero h1 {
    font-size: 42px;
  }

  .login-welcome-block h3 {
    font-size: 27px;
  }
}

/* ========================================
   prefers-reduced-motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-error {
    animation: none;
  }

  .login-screen.fade-out,
  .local-login-btn,
  .local-login-field,
  .local-login-btn i {
    transition: none;
  }
}


/* ========================================
   USER AVATAR (Header)
   ======================================== */

#user-avatar-container {
  display: none;
  position: relative;
  align-items: center;
  margin-left: 8px;
}

.user-avatar-wrapper {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-header-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.user-avatar-wrapper:hover .user-header-avatar {
  border-color: var(--primary-hover, #e05200);
}

.user-header-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback: iniciales cuando la foto de Google no carga */
.user-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
}

.user-dropdown-fallback-pic {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  flex-shrink: 0;
}

/* Dropdown del usuario */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.user-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.user-dropdown-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Roboto', sans-serif;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-dropdown-item i {
  width: 16px;
  text-align: center;
  font-size: 14px;
}

.user-dropdown-item i {
  color: var(--text-muted);
}


/* ========================================
   RESPONSIVE USER MENU
   ======================================== */

@media (max-width: 480px) {
  .user-dropdown {
    width: 240px;
    right: -8px;
  }
}

/* Ajuste solicitado: logo principal proporcional en panel de acceso */
.login-card-header-logo {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: clamp(30px, 5vh, 48px);
}

.login-logo-wide {
  display: block;
  width: 70%;
  height: auto;
  min-width: 0;
  border-radius: 24px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  padding: clamp(14px, 2vw, 20px);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

@media (max-width: 560px) {
  .login-card-header-logo {
    margin-bottom: 26px;
  }

  .login-logo-wide {
    width: 70%;
    height: auto;
    min-width: 0;
    border-radius: 20px;
    padding: 14px;
  }
}

/* Ajustes v4: bienvenida centrada, logo enlazado y redes sociales */
.login-logo-link {
  display: flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
}

.login-logo-link .login-logo-wide {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.login-logo-link:hover .login-logo-wide {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

.login-welcome-block {
  text-align: center;
}

.login-welcome-block h3 {
  text-align: center;
}

.login-access-label {
  margin-left: auto;
  margin-right: auto;
}

.login-footer-brand {
  margin-bottom: 14px;
}

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

.login-social-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 24px rgba(0, 0, 0, 0.16);
  transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.login-social-link i {
  color: #ffffff;
}

.login-social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(250, 92, 0, 0.45);
  background: rgba(250, 92, 0, 0.12);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(250, 92, 0, 0.08);
}

@media (max-width: 560px) {
  .login-social-link {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}


/* ========================================
   Ajustes v5: login móvil full-screen sin scroll
   ======================================== */
@media (max-width: 860px) {
  .login-screen.visible {
    display: block;
  }

  .login-screen {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .login-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 4vw, 28px);
    overflow: hidden;
    background:
      linear-gradient(145deg, rgba(9, 13, 17, 0.72) 0%, rgba(18, 25, 30, 0.60) 48%, rgba(250, 92, 0, 0.14) 100%),
      url('../fondo.jpg') center center / cover no-repeat,
      var(--bg-darker);
  }

  .login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
      radial-gradient(circle at 20% 14%, rgba(250, 92, 0, 0.25), transparent 28%),
      radial-gradient(circle at 84% 86%, rgba(52, 152, 219, 0.16), transparent 34%),
      linear-gradient(180deg, rgba(8, 12, 15, 0.18), rgba(8, 12, 15, 0.72));
    pointer-events: none;
  }

  .login-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.28;
    pointer-events: none;
  }

  .login-hero {
    position: absolute;
    inset: 0;
    min-height: 0;
    padding: 0;
    background: transparent;
    pointer-events: none;
  }

  .login-hero::before,
  .login-hero::after,
  .login-hero-overlay {
    display: none;
  }

  .login-hero-content {
    display: none;
  }

  .login-hero-mapline,
  .login-hero-orbit {
    opacity: 0.35;
  }

  .login-card {
    z-index: 2;
    width: min(100%, 430px);
    height: auto;
    min-height: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  .login-card::before,
  .login-card::after {
    display: none;
  }

  .login-panel-inner {
    width: 100%;
    max-height: calc(100dvh - 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(18px, 5vw, 28px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 28px;
    background:
      linear-gradient(180deg, rgba(38, 50, 56, 0.88), rgba(21, 27, 32, 0.92));
    box-shadow:
      0 28px 70px rgba(0, 0, 0, 0.46),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    overflow: hidden;
  }

  .login-card-header-logo {
    margin-bottom: 16px;
  }

  .login-logo-wide {
    width: min(70%, 280px);
    height: auto;
    padding: 12px;
    border-radius: 22px;
  }

  .login-welcome-block {
    margin-bottom: 14px;
  }

  .login-access-label {
    margin-bottom: 10px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .login-welcome-block h3 {
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1;
  }

  #google-signin-btn {
    min-height: 44px;
  }

  #btn-public-access-legacy {
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
  }

  .login-divider {
    margin: 14px 0 12px;
    gap: 9px;
    font-size: 9px;
    letter-spacing: 0.75px;
  }

  .local-login-form {
    gap: 9px;
  }

  .local-login-field {
    min-height: 44px;
    border-radius: 14px;
    padding: 0 12px;
  }

  .local-login-field input {
    padding: 11px 0;
    font-size: 13px;
  }

  .login-options-row {
    min-height: 22px;
  }

  .remember-me-label {
    font-size: 11px;
  }

  .remember-me-box {
    width: 16px;
    height: 16px;
    border-radius: 5px;
  }

  .local-login-btn {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
  }

  .login-error {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .login-footer {
    margin-top: 14px;
    font-size: 10px;
  }

  .login-footer-brand {
    margin-bottom: 10px;
  }

  .login-socials {
    gap: 8px;
  }

  .login-social-link {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .login-version {
    position: fixed;
    right: 12px;
    bottom: 10px;
    font-size: 9px;
  }
}

@media (max-width: 560px) {
  .login-shell {
    padding: 12px;
  }

  .login-panel-inner {
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 24px;
  }

  .login-card-header-logo {
    margin-bottom: 12px;
  }

  .login-logo-wide {
    width: 64%;
    padding: 10px;
    border-radius: 18px;
  }

  .login-welcome-block {
    margin-bottom: 12px;
  }

  .login-access-label {
    margin-bottom: 8px;
  }

  .login-divider {
    margin: 12px 0 10px;
  }

  .login-footer {
    margin-top: 12px;
  }
}

@media (max-height: 700px) and (max-width: 860px) {
  .login-shell {
    padding: 10px;
  }

  .login-panel-inner {
    max-height: calc(100dvh - 20px);
    padding: 16px;
    border-radius: 22px;
  }

  .login-card-header-logo {
    margin-bottom: 10px;
  }

  .login-logo-wide {
    width: min(56%, 230px);
    padding: 8px;
    border-radius: 16px;
  }

  .login-welcome-block {
    margin-bottom: 10px;
  }

  .login-access-label {
    margin-bottom: 7px;
    padding: 5px 9px;
    font-size: 9px;
  }

  .login-welcome-block h3 {
    font-size: 25px;
  }

  #google-signin-btn {
    min-height: 40px;
  }

  #btn-public-access-legacy {
    height: 40px !important;
    min-height: 40px !important;
  }

  .login-divider {
    margin: 10px 0 8px;
    font-size: 8.5px;
  }

  .local-login-form {
    gap: 7px;
  }

  .local-login-field,
  .local-login-btn {
    min-height: 40px;
  }

  .local-login-field input {
    padding: 9px 0;
  }

  .login-options-row {
    min-height: 20px;
  }

  .login-footer {
    margin-top: 10px;
  }

  .login-footer-brand {
    margin-bottom: 8px;
  }

  .login-social-link {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

@media (max-height: 600px) and (max-width: 860px) {
  .login-panel-inner {
    transform: scale(0.92);
    transform-origin: center center;
  }
}

@media (max-height: 520px) and (max-width: 860px) {
  .login-panel-inner {
    transform: scale(0.82);
  }
}

@media (max-height: 440px) and (max-width: 860px) {
  .login-panel-inner {
    transform: scale(0.74);
  }
}

/* ========================================
   Ajuste v150: login desktop compacto dinámico por altura
   Mantiene el layout de dos columnas y no interviene la animación de Fredy.
   ======================================== */
@media (min-width: 861px) {
  .login-screen {
    height: calc(var(--login-vh, 1vh) * 100);
    min-height: calc(var(--login-vh, 1vh) * 100);
    overflow: hidden;
  }

  .login-shell,
  .login-hero,
  .login-card {
    height: calc(var(--login-vh, 1vh) * 100);
    min-height: 0;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.82fr);
    overflow: hidden;
  }

  .login-hero {
    padding: clamp(34px, 5vw, 84px);
  }

  .login-card {
    padding: clamp(18px, 3.6vw, 58px);
    overflow: hidden;
  }

  .login-panel-inner {
    width: min(100%, clamp(370px, 27vw, 430px));
    max-height: calc(var(--login-vh, 1vh) * 100 - 24px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-card-header-logo {
    margin-bottom: clamp(14px, 4.2vh, 48px);
  }

  .login-logo-wide {
    width: clamp(210px, 22vh, 300px);
    max-width: 70%;
    padding: clamp(10px, 1.8vh, 20px);
    border-radius: clamp(16px, 2.4vh, 24px);
  }

  .login-welcome-block {
    margin-bottom: clamp(10px, 2.4vh, 24px);
  }

  .login-access-label {
    margin-bottom: clamp(7px, 1.65vh, 16px);
    padding: clamp(5px, 0.85vh, 7px) clamp(9px, 1.25vh, 11px);
    font-size: clamp(9px, 1.12vh, 11px);
  }

  .login-welcome-block h3 {
    font-size: clamp(26px, 4.8vh, 42px);
    line-height: 1.04;
  }

  #google-signin-btn {
    min-height: clamp(39px, 5.5vh, 48px);
  }

  #btn-public-access-legacy {
    height: clamp(39px, 5.5vh, 48px) !important;
    min-height: clamp(39px, 5.5vh, 48px) !important;
    border-radius: clamp(12px, 1.9vh, 15px) !important;
  }

  .login-divider {
    margin: clamp(8px, 2.7vh, 24px) 0 clamp(7px, 1.9vh, 16px);
    gap: clamp(8px, 1.35vh, 12px);
    font-size: clamp(8.5px, 1.08vh, 10px);
    letter-spacing: clamp(0.55px, 0.12vh, 0.95px);
  }

  .local-login-form {
    gap: clamp(7px, 1.35vh, 12px);
  }

  .local-login-field {
    min-height: clamp(38px, 5.5vh, 50px);
    border-radius: clamp(12px, 1.9vh, 15px);
    padding: 0 clamp(11px, 1.55vh, 14px);
  }

  .local-login-field input {
    padding: clamp(8px, 1.55vh, 14px) 0;
    font-size: clamp(12.5px, 1.55vh, 14px);
  }

  .local-login-field i {
    font-size: clamp(12px, 1.45vh, 14px);
  }

  .login-options-row {
    min-height: clamp(19px, 2.7vh, 28px);
  }

  .remember-me-label {
    font-size: clamp(10.5px, 1.25vh, 12px);
  }

  .remember-me-box {
    width: clamp(15px, 2vh, 18px);
    height: clamp(15px, 2vh, 18px);
    border-radius: clamp(5px, 0.75vh, 6px);
  }

  .local-login-btn {
    min-height: clamp(39px, 5.5vh, 50px);
    padding: clamp(9px, 1.55vh, 12px) 16px;
    border-radius: clamp(12px, 1.9vh, 15px);
  }

  .login-error {
    margin-top: clamp(8px, 1.8vh, 16px);
    padding: clamp(8px, 1.45vh, 11px) clamp(10px, 1.7vh, 13px);
    font-size: clamp(11px, 1.25vh, 12px);
  }

  .login-footer {
    margin-top: clamp(8px, 2.9vh, 30px);
    font-size: clamp(9.5px, 1.18vh, 11px);
  }

  .login-footer-brand {
    margin-bottom: clamp(6px, 1.65vh, 14px);
  }

  .login-socials {
    gap: clamp(7px, 1.2vh, 10px);
  }

  .login-social-link {
    width: clamp(27px, 3.9vh, 34px);
    height: clamp(27px, 3.9vh, 34px);
    font-size: clamp(11px, 1.55vh, 14px);
  }

  .login-version {
    right: clamp(14px, 1.6vw, 22px);
    bottom: clamp(10px, 1.8vh, 18px);
  }

  .login-hero-content {
    margin-bottom: clamp(14px, 4.8vh, 68px);
  }

  .login-kicker {
    padding: clamp(6px, 1vh, 8px) clamp(11px, 1.5vh, 14px);
    margin-bottom: clamp(12px, 2.5vh, 22px);
    font-size: clamp(10px, 1.35vh, 12px);
  }

  .login-hero h1 {
    font-size: clamp(54px, 12vh, 118px);
  }

  .login-hero p {
    margin-top: clamp(10px, 2.55vh, 22px);
    font-size: clamp(15px, 2.25vh, 21px);
    line-height: clamp(1.25, 0.18vh + 1.15, 1.55);
  }

  .login-feature-grid {
    gap: clamp(8px, 1.35vh, 12px);
    margin-top: clamp(14px, 3.8vh, 34px);
  }

  .login-feature-card {
    min-width: clamp(150px, 10.5vw, 168px);
    gap: clamp(8px, 1.4vh, 12px);
    padding: clamp(9px, 1.55vh, 13px) clamp(12px, 1.8vh, 15px);
  }

  .login-feature-card i {
    width: clamp(24px, 3.5vh, 30px);
    height: clamp(24px, 3.5vh, 30px);
    font-size: clamp(11px, 1.5vh, 13px);
  }

  .login-feature-card span {
    font-size: clamp(11.5px, 1.45vh, 13px);
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  .login-card {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .login-logo-wide {
    width: clamp(190px, 20vh, 260px);
  }

  .login-footer-brand {
    margin-bottom: 7px;
  }
}

@media (min-width: 861px) and (max-height: 680px) {
  .login-panel-inner {
    transform: scale(0.94);
    transform-origin: center center;
  }

  .login-hero-content {
    transform: scale(0.95);
    transform-origin: left bottom;
  }
}

@media (min-width: 861px) and (max-height: 600px) {
  .login-panel-inner {
    transform: scale(0.86);
  }

  .login-hero-content {
    transform: scale(0.88);
  }
}

/* Refinamiento v151: conserva el tamaño original en escritorios altos y compacta solo cuando la altura útil baja. */
@media (min-width: 861px) {
  .login-logo-wide {
    width: 70%;
    max-width: 300px;
    padding: clamp(14px, 2vw, 20px);
    border-radius: 24px;
  }

  .login-card-header-logo {
    margin-bottom: clamp(24px, 5vh, 48px);
  }

  .login-hero h1 {
    font-size: clamp(58px, 8.2vw, 118px);
  }

  .login-hero p {
    margin-top: 22px;
    font-size: clamp(16px, 1.7vw, 21px);
    line-height: 1.55;
  }

  .local-login-field,
  .local-login-btn {
    min-height: clamp(42px, 6.2vh, 50px);
  }

  #google-signin-btn,
  #btn-public-access-legacy {
    min-height: clamp(42px, 6.2vh, 48px) !important;
  }

  #btn-public-access-legacy {
    height: clamp(42px, 6.2vh, 48px) !important;
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  .login-card-header-logo {
    margin-bottom: clamp(14px, 3.8vh, 28px);
  }

  .login-logo-wide {
    width: clamp(210px, 34vh, 260px);
    max-width: 70%;
    padding: clamp(10px, 1.8vh, 16px);
    border-radius: clamp(16px, 2.3vh, 22px);
  }

  .login-welcome-block {
    margin-bottom: clamp(10px, 2.1vh, 16px);
  }

  .login-access-label {
    margin-bottom: clamp(7px, 1.45vh, 11px);
  }

  .login-welcome-block h3 {
    font-size: clamp(27px, 4.7vh, 36px);
  }

  .login-divider {
    margin: clamp(9px, 2.15vh, 16px) 0 clamp(8px, 1.6vh, 12px);
  }

  .login-footer {
    margin-top: clamp(10px, 2.4vh, 18px);
  }

  .login-hero h1 {
    font-size: clamp(64px, 13vh, 98px);
  }

  .login-hero p {
    margin-top: clamp(12px, 2.1vh, 16px);
    font-size: clamp(15px, 2.1vh, 18px);
    line-height: 1.42;
  }

  .login-feature-grid {
    margin-top: clamp(16px, 3vh, 24px);
  }
}

@media (min-width: 861px) and (max-height: 680px) {
  .login-logo-wide {
    width: clamp(185px, 31vh, 230px);
  }

  .login-hero h1 {
    font-size: clamp(58px, 12vh, 84px);
  }
}


/* v153: ocultar número de versión en pantalla de login */
.login-version { display: none !important; }
