/* ===========================================
  LOGIN - Landing Principal
=========================================== */

/* -------------------------------------------
  Sección
------------------------------------------- */
.login-section {
  background: var(--gris-claro);
  padding-bottom: 2rem;
}

/* -------------------------------------------
  Wrapper centrado
------------------------------------------- */
.login-wrapper {
  max-width: 520px;
  margin: 0 auto;
}

/* -------------------------------------------
  Tabs
------------------------------------------- */
.login-tabs {
  display: flex;
  background: #fff;
  border-radius: 0.875rem 0.875rem 0 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: none;
  overflow: hidden;
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gris);
  background: #f8f9fa;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.login-tab:hover {
  color: var(--gris-oscuro);
  background: #fff;
}

.login-tab--active {
  color: var(--p-morado);
  background: #fff;
  border-bottom-color: var(--p-morado);
  pointer-events: none;
  cursor: default;
}

/* -------------------------------------------
  Card del formulario
------------------------------------------- */
.login-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.login-tabs + .login-card {
  border-radius: 0 0 1rem 1rem;
}

/* -------------------------------------------
  Campos
------------------------------------------- */
.login-field-group {
  margin-bottom: 1.25rem;
}

.login-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gris-oscuro);
  margin-bottom: 0.5rem;
}

/* -------------------------------------------
  Inputs
------------------------------------------- */
.login-input {
  border-radius: 0.625rem !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  font-size: 0.9375rem;
  color: #333333 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
  border-color: var(--p-morado) !important;
  box-shadow: 0 0 0 3px rgba(117, 102, 219, 0.12) !important;
}

.login-input--left {
  border-right: none !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.login-input-group {
  display: flex;
}

.login-eye-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: none;
  border-radius: 0 0.625rem 0.625rem 0;
  color: var(--gris);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.login-eye-btn:hover {
  color: var(--p-morado);
  background: rgba(117, 102, 219, 0.05);
}

/* -------------------------------------------
  Teléfono (indicativo + número)
------------------------------------------- */
.login-phone-wrapper {
  display: flex;
}

.login-phone-prefix {
  position: relative;
  flex-shrink: 0;
}

/* Trigger */
.login-phone-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem 0 0.75rem;
  background: #f8f9fa;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-right: none;
  border-radius: 0.625rem 0 0 0.625rem;
  height: 58px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.2s ease;
}

.login-phone-btn:hover { background: #eeeef5; }

.login-phone-btn:focus {
  outline: none;
  border-color: var(--p-morado);
  box-shadow: 0 0 0 3px rgba(117, 102, 219, 0.12);
}

.login-phone-prefix-flag { font-size: 1.125rem; line-height: 1; }

.login-phone-prefix-code {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gris-oscuro);
}

.login-phone-prefix-chevron {
  color: var(--gris);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.login-phone-prefix--open .login-phone-prefix-chevron {
  transform: rotate(180deg);
}

/* Input número */
.login-phone-wrapper .login-input {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  height: 58px !important;
}

/* Dropdown */
.login-phone-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 280px;
  overflow: hidden;
}

.login-phone-search-wrapper {
  padding: 0.625rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.login-phone-search {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gris-oscuro);
  outline: none;
  transition: border-color 0.2s ease;
}

.login-phone-search:focus { border-color: var(--p-morado); }

.login-phone-list {
  list-style: none;
  margin: 0;
  padding: 0.375rem 0;
  max-height: 220px;
  overflow-y: auto;
}

.login-phone-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-phone-option:hover,
.login-phone-option--selected { background: rgba(117, 102, 219, 0.06); }

.login-phone-flag-img-sm {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.login-phone-flag-emoji-sm {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.login-phone-option-name {
  font-size: 0.875rem;
  color: var(--gris-oscuro);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-phone-option-code {
  font-size: 0.8125rem;
  color: var(--gris);
  font-weight: 500;
  flex-shrink: 0;
}

.login-phone-no-results {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  color: var(--gris);
  text-align: center;
}

/* -------------------------------------------
  Toggle canal / método
------------------------------------------- */
.login-toggle-group {
  display: flex;
  gap: 0.5rem;
}

.login-toggle-input {
  display: none;
}

.login-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gris);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.login-toggle-btn:hover {
  border-color: var(--p-morado);
  color: var(--p-morado);
  background: rgba(117, 102, 219, 0.04);
}

.login-toggle-input:checked + .login-toggle-btn {
  border-color: var(--p-morado);
  color: var(--p-morado);
  background: rgba(117, 102, 219, 0.08);
  font-weight: 600;
}

.login-toggle-text-short { display: inline; }
.login-toggle-text-full  { display: none; }

/* -------------------------------------------
  Código de verificación
------------------------------------------- */
.login-code-hint {
  font-size: 0.875rem;
  color: var(--gris);
  margin-bottom: 0.75rem;
}

.login-send-code-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  border: 1.5px solid var(--p-morado);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--p-morado);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}

.login-send-code-btn:hover:not(:disabled) {
  background: var(--p-morado);
  color: #fff;
}

.login-send-code-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------------------------
  Error
------------------------------------------- */
.login-error-msg {
  font-size: 0.85rem;
  color: #dc3545;
  margin-top: -0.75rem;
  margin-bottom: 0.75rem;
}

/* -------------------------------------------
  Olvidé contraseña
------------------------------------------- */
.login-forgot {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

.login-forgot a {
  font-size: 0.85rem;
  color: var(--p-morado);
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.login-forgot a:hover {
  opacity: 0.75;
}

/* -------------------------------------------
  Botón submit
------------------------------------------- */
.login-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--p-morado);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  background: #6253c8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(117, 102, 219, 0.35);
}

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

.login-submit-btn:disabled {
  background: #c4bef0;
  color: #fff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* -------------------------------------------
  Social login
------------------------------------------- */
.login-social {
  margin-bottom: 1.5rem;
}

.login-social-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 0;
}

.login-social-divider::before,
.login-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.login-social-divider span {
  font-size: 0.8125rem;
  color: var(--gris);
  font-weight: 500;
  white-space: nowrap;
}

.login-social-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
}

.login-social-btn-text {
  display: none;
}

.login-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gris-oscuro);
  background: #fff;
  transition: all 0.2s ease;
}

.login-social-btn:hover {
  border-color: var(--p-morado);
  color: var(--p-morado);
  background: rgba(117, 102, 219, 0.04);
}

/* -------------------------------------------
  Ya autenticado / Confirmación social
------------------------------------------- */
.login-authenticated {
  text-align: center;
  padding: 1.75rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.login-auth-icon {
  color: var(--p-morado);
  margin-bottom: 1rem;
}

.login-auth-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gris-oscuro);
  margin-bottom: 0.5rem;
}

.login-auth-desc {
  font-size: 0.9375rem;
  color: var(--gris);
  margin-bottom: 1.75rem;
}

.login-auth-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Botones de acción */
.login-btn-primary {
  padding: 0.75rem 1.75rem;
  border-radius: 3rem;
  background: var(--p-morado);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.login-btn-primary:hover {
  background: #6253c8;
  color: #fff;
  transform: translateY(-1px);
}

.login-btn-secondary {
  padding: 0.75rem 1.75rem;
  border-radius: 3rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  color: var(--gris);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.login-btn-secondary:hover {
  border-color: #dc3545;
  color: #dc3545;
}

/* -------------------------------------------
  Restablecimiento de contraseña
------------------------------------------- */
.login-page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gris-oscuro);
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-info-text {
  font-size: 0.9375rem;
  color: var(--gris);
  line-height: 1.65;
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-help-text {
  font-size: 0.8125rem;
  color: var(--gris);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.login-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--p-morado);
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.login-back-link:hover {
  opacity: 0.75;
  color: var(--p-morado);
}

.login-success-icon {
  display: flex;
  justify-content: center;
  color: var(--p-verde);
  margin-bottom: 1rem;
}

.login-invalid-icon {
  color: #f59e0b;
}

.login-invalid-link {
  text-align: center;
}

.login-form-errors {
  margin-bottom: 0.75rem;
}

.login-action-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1.5rem;
}

.login-action-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gris-oscuro);
  background: #fff;
  transition: all 0.2s ease;
}

.login-action-link:hover {
  border-color: var(--p-morado);
  color: var(--p-morado);
  background: rgba(117, 102, 219, 0.04);
}

/* -------------------------------------------
  Responsive
------------------------------------------- */
@media (min-width: 576px) {
  .login-social-btn-text {
    display: inline;
  }

  .login-social-btn {
    flex: 1;
    min-width: 120px;
  }

  .login-toggle-text-short { display: none; }
  .login-toggle-text-full  { display: inline; }
}

@media (min-width: 992px) {
  .login-section {
    padding-bottom: 6rem;
  }
}
