/**
 * Hello Plataforma · Login Screen Styles
 *
 * Card oscura premium con view transitions
 * entre login ↔ recuperación ↔ enviado.
 */


/* ============================================================
   WRAPPER · FULL SCREEN
   ============================================================ */

.hp-login-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--hp-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  padding-top: max(20px, env(safe-area-inset-top, 0));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0));
}

.hp-login-content {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ============================================================
   BACK LINK
   ============================================================ */

.hp-login-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hp-font-base);
  font-size: 13px;
  font-weight: 500;
  color: var(--hp-text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  align-self: flex-start;
  transition: background-color var(--hp-duration-normal) var(--hp-ease);
}

.hp-login-brand-link:hover {
  background: var(--hp-bg-primary);
}

.hp-login-brand-link i {
  font-size: 16px;
}


/* ============================================================
   CARD PREMIUM OSCURA
   ============================================================ */

.hp-login-card {
  background: var(--hp-gradient-dark-card);
  color: #FFFFFF;
  border-radius: 22px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px -10px rgba(15, 14, 22, 0.40);
}

.hp-login-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 135, 208, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hp-login-card::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(149, 117, 205, 0.18) 0%, transparent 70%);
  pointer-events: none;
}


/* ============================================================
   VIEW SYSTEM (login ↔ forgot ↔ sent)
   ============================================================ */

.hp-login-view {
  position: relative;
  z-index: 1;
}

.hp-login-view[hidden] {
  display: none !important;
}

.hp-login-view.is-entering {
  animation: hpViewSlideIn 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hpViewSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   CARD HEADER
   ============================================================ */

.hp-login-card-header {
  text-align: center;
  margin-bottom: 22px;
}

.hp-login-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168, 135, 208, 0.30) 0%, rgba(149, 117, 205, 0.15) 100%);
  border: 0.5px solid rgba(212, 191, 232, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.hp-login-icon i {
  font-size: 26px;
  color: #FFFFFF;
}

.hp-login-icon--success {
  background: linear-gradient(135deg, rgba(29, 158, 117, 0.40) 0%, rgba(29, 158, 117, 0.15) 100%);
  border-color: rgba(29, 158, 117, 0.40);
}

.hp-login-title {
  font-family: var(--hp-font-base);
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hp-login-sub {
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: rgba(212, 191, 232, 0.75);
  margin: 8px 0 0;
  line-height: 1.5;
}


/* ============================================================
   FORM
   ============================================================ */

.hp-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* ============================================================
   LABEL
   ============================================================ */

.hp-login-label {
  font-family: var(--hp-font-base);
  font-size: 11px;
  font-weight: 600;
  color: rgba(212, 191, 232, 0.80);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 2px;
}


/* ============================================================
   INPUT
   ============================================================ */

.hp-login-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 191, 232, 0.20);
  border-radius: 12px;
  padding: 14px 16px;
  color: #FFFFFF;
  font-family: var(--hp-font-base);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--hp-duration-normal) var(--hp-ease),
              background-color var(--hp-duration-normal) var(--hp-ease),
              box-shadow var(--hp-duration-normal) var(--hp-ease);
  -webkit-appearance: none;
  appearance: none;
}

.hp-login-input::placeholder {
  color: rgba(212, 191, 232, 0.40);
  font-weight: 400;
}

.hp-login-input:focus {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(212, 191, 232, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 135, 208, 0.15);
}

.hp-login-input.has-error {
  border-color: #E8956C;
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

.hp-login-input:-webkit-autofill,
.hp-login-input:-webkit-autofill:hover,
.hp-login-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(40, 36, 56, 1) inset !important;
  -webkit-text-fill-color: #FFFFFF !important;
  caret-color: #FFFFFF;
}


/* ============================================================
   PASSWORD CON TOGGLE
   ============================================================ */

.hp-login-password-wrap {
  position: relative;
}

.hp-login-password-wrap .hp-login-input {
  padding-right: 48px;
}

.hp-login-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(212, 191, 232, 0.60);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--hp-duration-normal) var(--hp-ease),
              background-color var(--hp-duration-normal) var(--hp-ease);
}

.hp-login-pw-toggle:hover {
  color: rgba(212, 191, 232, 0.95);
  background: rgba(255, 255, 255, 0.06);
}

.hp-login-pw-toggle i {
  font-size: 18px;
}


/* ============================================================
   REMEMBER CHECKBOX
   ============================================================ */

.hp-login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: rgba(212, 191, 232, 0.85);
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
  -webkit-user-select: none;
}

.hp-login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--hp-purple);
  cursor: pointer;
  margin: 0;
}


/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.hp-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--hp-gradient-purple-button);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 15px 20px;
  font-family: var(--hp-font-base);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
  margin-top: 6px;
  box-shadow: 0 4px 14px -2px rgba(149, 117, 205, 0.50),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform var(--hp-duration-normal) var(--hp-ease),
              box-shadow var(--hp-duration-normal) var(--hp-ease);
}

.hp-login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(149, 117, 205, 0.60),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hp-login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.hp-login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.hp-login-submit i {
  font-size: 17px;
}

.hp-login-submit.is-loading .hp-login-submit-label {
  opacity: 0.8;
}

.hp-login-submit.is-loading i {
  animation: hpSpin 800ms linear infinite;
}

@keyframes hpSpin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   ERROR MESSAGE
   ============================================================ */

.hp-login-error-msg {
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: #FFB89A;
  background: rgba(217, 119, 87, 0.12);
  border: 0.5px solid rgba(217, 119, 87, 0.30);
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  animation: hpViewSlideIn 250ms ease-out;
}

.hp-login-error-msg[hidden] {
  display: none !important;
}

.hp-login-error-msg:empty {
  display: none !important;
}

.hp-login-error-msg::before {
  content: '⚠';
  font-size: 14px;
}


/* ============================================================
   DIVIDER / FORGOT LINK
   ============================================================ */

.hp-login-divider {
  text-align: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 0.5px solid rgba(212, 191, 232, 0.18);
}

.hp-login-forgot-link {
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(212, 191, 232, 0.85);
  font-family: var(--hp-font-base);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--hp-duration-normal) var(--hp-ease),
              background-color var(--hp-duration-normal) var(--hp-ease);
}

.hp-login-forgot-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.hp-login-forgot-link i {
  font-size: 14px;
}


/* ============================================================
   SIGNUP CALLOUT (debajo de la card)
   ============================================================ */

.hp-login-signup {
  text-align: center;
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: var(--hp-text-secondary);
  margin: 0;
}

.hp-login-signup a {
  color: var(--hp-purple-deep);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--hp-duration-normal) var(--hp-ease);
}

.hp-login-signup a:hover {
  color: var(--hp-purple-anchor);
  text-decoration: underline;
}


/* ============================================================
   MOBILE TWEAKS
   ============================================================ */

@media (max-width: 380px) {
  .hp-login-card {
    padding: 22px 18px;
  }

  .hp-login-title {
    font-size: 20px;
  }

  .hp-login-icon {
    width: 50px;
    height: 50px;
  }

  .hp-login-icon i {
    font-size: 24px;
  }
}
