:root {
  --ff-blue: #2563eb;
  --ff-blue-hover: #1d4ed8;
  --ff-dark: #0f172a;
  --ff-muted: #64748b;
  --ff-bg: #f8fafc;
  --ff-border: #e2e8f0;
  --ff-card-border: #f1f5f9;
  --ff-red-bg: #fef2f2;
  --ff-red-text: #dc2626;
  --ff-red-border: #fee2e2;
  --ff-blue-bg: #eff6ff;
  --ff-blue-text: #2563eb;
  --ff-blue-border: #dbeafe;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-page {
  min-height: 100vh;
  background: var(--ff-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 448px;
  background: #ffffff;
  border: 1px solid var(--ff-card-border);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.auth-header {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo-link {
  display: inline-block;
  margin-bottom: 24px;
}

.auth-logo {
  height: 32px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.auth-header h1 {
  margin: 0;
  color: var(--ff-dark);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-header p {
  margin: 10px 0 0;
  color: var(--ff-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.flash-wrapper {
  margin-bottom: 24px;
}

.flash-message {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.flash-error {
  background: var(--ff-red-bg);
  color: var(--ff-red-text);
  border: 1px solid var(--ff-red-border);
}

.flash-info {
  background: var(--ff-blue-bg);
  color: var(--ff-blue-text);
  border: 1px solid var(--ff-blue-border);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group label,
.password-row label {
  display: block;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  border: 1px solid var(--ff-border);
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--ff-dark);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-group input:focus {
  border-color: var(--ff-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.password-row label {
  margin-bottom: 0;
}

.password-row a {
  color: var(--ff-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  font-style: italic;
}

.password-row a:hover {
  text-decoration: underline;
}

.captcha-wrapper {
  display: flex;
  justify-content: center;
}

.auth-button {
  width: 100%;
  background: var(--ff-blue);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.16);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.auth-button:hover {
  background: var(--ff-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(37, 99, 235, 0.22);
}

.auth-button:active {
  transform: scale(0.98);
}

.auth-footer {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--ff-card-border);
  text-align: center;
}

.auth-footer p {
  margin: 0;
  color: var(--ff-muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--ff-blue);
  font-weight: 800;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-footer span {
  display: block;
  margin-top: 16px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-style: italic;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 32px 24px;
    border-radius: 24px;
  }

  .password-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================================
   REGISTER / AUTH EXTRA
   ========================================================= */

.auth-layout {
  min-height: 100vh;
  background: #f8fafc;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-nav {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 16px 24px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.auth-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-nav-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-nav-links span {
  font-size: 0.88rem;
  color: #94a3b8;
}

.auth-nav-links a,
.auth-mobile-menu a {
  font-size: 0.88rem;
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}

.auth-nav-links a:hover,
.auth-mobile-menu a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.auth-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 2rem;
  cursor: pointer;
}

.auth-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease-in-out;
}

.hidden-menu {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 48px;
}

.register-card {
  max-width: 448px;
}

.label-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
}

.password-rules {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 0.7rem;
  color: #64748b;
}

.password-rules li.valid {
  color: #16a34a;
  font-weight: 700;
}

.flash-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #dcfce7;
}

.auth-bottom-footer {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  padding: 28px 16px;
}

.auth-bottom-footer p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (max-width: 768px) {
  .auth-nav-links {
    display: none;
  }

  .auth-menu-btn {
    display: block;
  }

  .auth-main {
    padding-top: 110px;
  }
}

@media (max-width: 520px) {
  .password-rules {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   FORGOT PASSWORD
   ========================================================= */

.forgot-card {
  max-width: 448px;
}

.auth-icon-circle {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon {
  width: 32px;
  height: 32px;
}

.auth-footer p a {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}
/* =========================================================
   AUTH LAYOUT / NAVBAR COMPARTIDO
   ========================================================= */

.auth-layout {
  min-height: 100vh;
  background: #f8fafc;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-nav {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 16px 24px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.auth-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-nav-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-nav-links span {
  font-size: 0.88rem;
  color: #94a3b8;
}

.auth-nav-links a,
.auth-mobile-menu a {
  font-size: 0.88rem;
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}

.auth-nav-links a:hover,
.auth-mobile-menu a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.auth-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 2rem;
  cursor: pointer;
}

.auth-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease-in-out;
}

.hidden-menu {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 48px;
}

.auth-bottom-footer {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  padding: 28px 16px;
}

.auth-bottom-footer p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (max-width: 768px) {
  .auth-nav-links {
    display: none;
  }

  .auth-menu-btn {
    display: block;
  }

  .auth-main {
    padding-top: 110px;
  }
}
/* =========================================================
   LOGIN 2FA
   ========================================================= */

.auth-2fa-card {
  max-width: 448px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(37, 99, 235, 0.14);
}

.auth-icon-square {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: #eff6ff;
  border-radius: 22px;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon-square span {
  font-size: 2rem;
  line-height: 1;
}

.otp-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 24px;
  text-align: center;
  color: #0f172a;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.38em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.otp-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-footer p a {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

@media (max-width: 520px) {
  .otp-input {
    font-size: 1.6rem;
    letter-spacing: 0.28em;
    padding: 15px 18px;
  }
}
/* =========================================================
   LOGIN MFA
   ========================================================= */

.auth-icon-shield {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.auth-shield-svg {
  width: 32px;
  height: 32px;
}

.auth-button-dark {
  background: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.auth-button-dark:hover {
  background: #1e293b;
}

.auth-support {
  margin-top: 32px;
  text-align: center;
}

.auth-support p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.auth-support a {
  display: inline-block;
  margin-top: 6px;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.auth-support a:hover {
  text-decoration: underline;
}

.auth-security-label {
  margin: 36px 0 0;
  color: #cbd5e1;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* =========================================================
   SETUP 2FA
   ========================================================= */

.setup-2fa-card {
  max-width: 448px;
  box-shadow: 0 25px 60px rgba(37, 99, 235, 0.14);
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.setup-step p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.setup-step strong {
  color: #0f172a;
  font-weight: 800;
}

.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.qr-box {
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 28px;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.qr-inner {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  line-height: 0;
}

.qr-inner svg {
  max-width: 220px;
  width: 100%;
  height: auto;
}

.setup-step-content {
  flex: 1;
}

.verify-2fa-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.setup-otp-input {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 13px 14px;
  text-align: center;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.setup-otp-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.verify-button {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0 22px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.verify-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.setup-actions {
  margin-top: 32px;
}

.back-dashboard-button {
  display: block;
  width: 100%;
  background: #f1f5f9;
  color: #64748b;
  text-align: center;
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.back-dashboard-button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.setup-actions p {
  margin: 16px 0 0;
  color: #94a3b8;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

@media (max-width: 520px) {
  .verify-2fa-form {
    flex-direction: column;
  }

  .verify-button {
    width: 100%;
    padding: 14px 20px;
  }

  .setup-otp-input {
    width: 100%;
  }
}

/* =========================================================
   UPDATE PASSWORD
   ========================================================= */

.update-password-card {
  max-width: 448px;
}

.auth-icon-success {
  background: #f0fdf4;
  color: #16a34a;
}

.auth-help-text {
  color: #94a3b8 !important;
  font-size: 0.78rem !important;
  line-height: 1.6;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.auth-button-dark {
  background: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.auth-button-dark:hover {
  background: #1e293b;
}
.qr-image {
  width: 260px;
  height: 260px;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
}

/* =========================================================
   SETUP 2FA - FORMULARIO RESPONSIVO
   ========================================================= */

.setup-2fa-card {
  max-width: 560px;
  width: 100%;
  overflow: hidden;
}

.setup-steps {
  width: 100%;
}

.setup-step-content {
  width: 100%;
}

.verify-2fa-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.setup-otp-input {
  width: 100%;
  min-width: 0;
  height: 68px;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.45rem;
  color: #0f172a;
}

.verify-button {
  height: 68px;
  min-width: 140px;
  border-radius: 14px;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 24px;
}

.setup-actions {
  width: 100%;
}

.back-dashboard-button {
  display: block;
  width: 100%;
  text-align: center;
}

/* Móvil */
@media (max-width: 640px) {
  .verify-2fa-form {
    grid-template-columns: 1fr;
  }

  .verify-button {
    width: 100%;
  }

  .setup-otp-input {
    letter-spacing: 0.35rem;
  }
  .gtm-noscript-frame {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    border: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}
