* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.3), transparent 35%),
    radial-gradient(circle at bottom right, rgba(91, 33, 182, 0.38), transparent 42%),
    linear-gradient(135deg, #09090f, #11111a 42%, #160f2e);
  color: #fff;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: rgba(17, 17, 26, 0.78);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.register-card {
  width: min(100%, 520px);
}

.brand {
  display: flex;
  align-items: center;
  margin-bottom: 34px;
}

.brand img {
  width: 120px;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
}

.login-copy .eyebrow {
  margin: 0 0 8px;
  color: #c4b5fd;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 800;
}

.login-copy h1,
.login-copy h2 {
  margin: 0;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
  color: #fff;
  letter-spacing: -0.8px;
}

.login-copy p:last-child {
  margin: 14px 0 28px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
}

.input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  transition: 0.2s ease;
}

.input-box:focus-within {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12);
}

.input-box i {
  color: #c084fc;
  font-size: 21px;
  flex-shrink: 0;
}

.input-box input,
.input-box select {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
}

.input-box input::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.toggle-pin {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  color: #c084fc;
  display: grid;
  place-items: center;
}

.select-box {
  position: relative;
}

.select-box select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
}

.select-box select:invalid {
  color: rgba(255, 255, 255, 0.36);
}

.select-box select option {
  background: #171321;
  color: #fff;
}

.select-arrow {
  pointer-events: none;
  margin-left: auto;
  color: #c084fc !important;
  font-size: 24px !important;
}

.admin-key-wrap {
  display: none !important;
}

.admin-key-wrap.show {
  display: grid !important;
}

.admin-key-note {
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  line-height: 1.4;
}

.login-error,
.login-success {
  display: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.login-error {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.login-success {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.login-error.show,
.login-success.show {
  display: block;
}

.login-btn {
  height: 58px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.3);
  transition: 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px rgba(139, 92, 246, 0.36);
}

.login-btn i {
  font-size: 22px;
}

.login-helper {
  margin: 4px 0 0;
  text-align: center;
}

.login-helper a {
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s ease;
}

.login-helper a:hover {
  color: #c084fc;
}

@media (max-width: 480px) {
  .login-page {
    padding: 16px;
  }

  .login-card {
    padding: 26px 22px;
    border-radius: 24px;
  }

  .brand img {
    width: 100px;
  }
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
}

.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: #8b5cf6;
}

/* ══════════════════════════════════════
   FEEDBACK MÓVIL — NAVEGACIÓN Y SELECTS
══════════════════════════════════════ */

.login-card {
  position: relative;
}

.auth-back-button {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 12;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.auth-back-button i {
  font-size: 22px;
}

.auth-back-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.auth-back-button:active {
  transform: scale(0.96);
}

.login-card > .brand {
  min-height: 42px;
  padding-left: 56px;
}

.native-select-box {
  position: relative;
  cursor: pointer;
  isolation: isolate;
}

.native-select-box .select-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.native-select-box .select-value.placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.native-select-box select {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.001;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}

.native-select-box > i,
.native-select-box .select-arrow,
.native-select-box .select-value {
  pointer-events: none;
}

.native-select-box:focus-within {
  border-color: rgba(168, 85, 247, 0.68);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
}

@media (max-width: 480px) {
  .login-page {
    place-items: start center;
    padding:
      max(18px, env(safe-area-inset-top))
      16px
      max(24px, env(safe-area-inset-bottom));
  }

  .login-card {
    margin-top: clamp(54px, 15vh, 132px);
  }

  .register-card {
    margin-top: 16px;
  }

  .auth-back-button {
    top: 18px;
    left: 18px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .login-card > .brand {
    padding-left: 50px;
  }
}
