/* ======================================================
   GATE CONTROL – Auth Pages  (login, forgot, register)
   ====================================================== */

/* ── Page-level body container ───────────────────────── */
.ck-login-page { min-height: 100vh; background: #eef3f9; }
.ck-login-page .container { width: 100%; max-width: none; min-height: 100vh; padding: 0; }
.ck-login-page .auth-wrapper { min-height: 100vh; display: block; }
.ck-login-page .ck-auth-stack { width: 100%; max-width: none; min-height: 100vh; }

.ck-login-page .alert {
  position: fixed; top: 16px; left: 50%; z-index: 20;
  width: min(92vw, 720px); transform: translateX(-50%);
}
.ck-login-page .ck-auth-footer {
  position: fixed; right: clamp(24px, 5vw, 84px); bottom: 24px; z-index: 2;
  margin: 0; color: #7b8798; font-size: 12px;
}

/* ======================================================
   LOGIN & FORGOT PASSWORD  (untouched)
   ====================================================== */

.login-page {
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(18px, 2.6vh, 44px) clamp(56px, 6.5vw, 106px) clamp(18px, 2.6vh, 44px) 48px;
  overflow: hidden;
  background-color: #e8f2fb;
  background-image:
    linear-gradient(90deg,
      rgba(232, 241, 251, 0.00) 0%,
      rgba(232, 241, 251, 0.06) 44%,
      rgba(232, 241, 251, 0.74) 68%,
      rgba(232, 241, 251, 0.97) 86%,
      rgba(232, 241, 251, 1.00) 100%),
    url("../custom/checkin/bk-login.jpg");
  background-size: auto 100%;
  background-position: left center;
  background-repeat: no-repeat;
}

.login-content {
  width: 100%;
  max-width: 492px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(210,230,255,0.12));
}

.login-form-shell { width: min(100%, 420px); }
.login-form-shell .mb-3.login-field { margin-bottom: 12px !important; }

/* Login card */
.ck-meta-auth .ck-meta-login-box.login-card {
  width: 100%;
  margin: 0;
  padding: clamp(26px, 2.4vw, 38px) clamp(26px, 2.8vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background: linear-gradient(158deg, #ffffff 0%, #f4f9ff 100%);
  box-shadow:
    0 0 0 1px rgba(47, 111, 228, 0.07),
    0 4px 12px rgba(15, 35, 75, 0.06),
    0 28px 72px rgba(15, 35, 75, 0.18);
  backdrop-filter: blur(16px);
}

.login-brand { margin-bottom: 16px; }
.ck-meta-auth .login-brand img { width: min(100%, 200px); max-height: 56px; object-fit: contain; }

.login-heading { margin-bottom: 18px; }
.login-heading h4 { margin: 0 0 5px; color: #0d1e38; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.25px; }
.login-heading p  { margin: 0; color: #64748b; font-size: 13.5px; line-height: 1.45; }

.login-field .form-label { margin-bottom: 7px; color: #1a2f4a; font-size: 12.5px; font-weight: 700; }

/* Icon wrapper */
.login-field-icon { position: relative; }
.login-field-icon > .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9db3cb; font-size: 15px; pointer-events: none; z-index: 2; line-height: 1; }
.login-field-icon > .form-control { padding-left: 38px !important; }

/* Inputs */
.login-field .form-control,
.login-password-group .btn { min-height: 48px; border-color: #d7e3ef; }

.login-field .form-control { border-radius: 10px; color: #1a2f4a; background: #f8fbff; font-size: 14px; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.login-field .form-control:focus { border-color: #3b76e1; background: #ffffff; box-shadow: 0 0 0 3px rgba(59, 118, 225, 0.15); }

.login-password-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.login-password-group .btn { width: 50px; border-radius: 0 10px 10px 0; color: #9db3cb; background: #f8fbff; border-color: #d7e3ef; border-left-color: transparent; transition: color .14s ease, background .14s ease; }
.login-password-group .btn:hover, .login-password-group .btn:focus { color: #3b76e1; background: #eef4ff; border-color: #d7e3ef; box-shadow: none; }

/* Actions */
.login-actions { margin-top: 18px; }
.login-actions .btn { min-height: 48px; border-radius: 10px; font-weight: 700; font-size: 14.5px; letter-spacing: 0.01em; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }

.login-actions .btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #4b8ef8 0%, #2563eb 55%, #1d4fd8 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 18px rgba(37,99,235,0.28), 0 14px 32px rgba(37,99,235,0.18);
}
.login-actions .btn-primary:hover, .login-actions .btn-primary:focus {
  background: linear-gradient(135deg, #5a97ff 0%, #2f70f0 55%, #2454cc 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 10px 22px rgba(37,99,235,0.36), 0 18px 38px rgba(37,99,235,0.22);
  transform: translateY(-1px);
}

.login-help-link { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; color: #2563eb; font-size: 13px; font-weight: 600; text-decoration: none; transition: color .14s ease; }
.login-help-link:hover, .login-help-link:focus { color: #1d4ed8; text-decoration: underline; }

.login-actions .btn-outline-success { border: 1.5px solid #22c55e; color: #15803d; background: linear-gradient(170deg, #f0fdf4, #dcfce7); font-size: 13.5px; min-height: 46px; }
.login-actions .btn-outline-success:hover, .login-actions .btn-outline-success:focus { border-color: #16a34a; background: linear-gradient(170deg, #dcfce7, #bbf7d0); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(22,163,74,0.18); }

.login-divider { display: flex; align-items: center; gap: 10px; color: #b4c4d8; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin: 2px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, transparent, #dbe8f4, transparent); }

/* Login responsive */
@media (max-width: 1100px) {
  .login-page {
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(18px, 2.6vh, 36px) 20px clamp(56px, 8vh, 84px);
    padding: clamp(18px, 2.6svh, 36px) 20px clamp(56px, 8svh, 84px);
    background-image:
      linear-gradient(180deg, rgba(232,241,251,0.36) 0%, rgba(232,241,251,0.60) 48%, rgba(232,241,251,0.88) 100%),
      url("../custom/checkin/bk-login.jpg");
    background-size: cover;
    background-position: 44% center;
  }
  .ck-login-page .ck-auth-footer { position: static; padding: 0 24px 28px; text-align: center; }
}

/* ── Tablet / iPad (641px – 1024px): overlay más fuerte ──────────── */
@media (max-width: 1024px) and (min-width: 641px) {
  .login-page {
    align-items: center;
    justify-content: center;
    background-image:
      linear-gradient(90deg,
        rgba(232,241,251,0.20) 0%,
        rgba(232,241,251,0.50) 42%,
        rgba(232,241,251,0.72) 100%),
      linear-gradient(180deg,
        rgba(8,21,43,0.10) 0%,
        rgba(255,255,255,0.10) 40%,
        rgba(255,255,255,0.36) 100%),
      url("../custom/checkin/bk-login.jpg");
    background-size: cover;
    background-position: 42% center;
    padding: 22px 20px 34px;
    padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .login-content {
    max-width: 456px;
    padding: 10px;
    background: rgba(255,255,255,0.18);
    box-shadow: 0 20px 60px rgba(20,42,74,0.14);
  }
  .login-form-shell {
    width: min(100%, 398px);
  }
  .ck-meta-auth .ck-meta-login-box.login-card {
    padding: 28px 30px;
    background: linear-gradient(158deg, rgba(255,255,255,0.96) 0%, rgba(245,249,255,0.94) 100%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .login-heading h4 {
    font-size: 25px;
  }
}

@media (max-width: 1024px) and (min-width: 641px) and (orientation: landscape) {
  .login-page {
    padding-top: 18px;
    padding-bottom: 22px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(22px, env(safe-area-inset-bottom));
    background-position: 38% center;
  }
  .login-content {
    max-width: 430px;
  }
  .login-form-shell {
    width: min(100%, 376px);
  }
  .ck-meta-auth .ck-meta-login-box.login-card {
    padding: 22px 28px;
    border-radius: 24px;
  }
  .login-brand {
    margin-bottom: 10px;
  }
  .ck-meta-auth .login-brand img {
    max-height: 48px;
  }
  .login-heading {
    margin-bottom: 14px;
  }
  .login-heading h4 {
    font-size: 23px;
  }
  .login-heading p {
    font-size: 12.5px;
  }
  .login-field .form-control,
  .login-password-group .btn,
  .login-actions .btn {
    min-height: 44px;
  }
  .login-actions {
    margin-top: 14px;
  }
}

/* ── Móvil (≤ 640px): sin imagen de fondo — gradiente premium ──── */
@media (max-width: 640px) {
  .login-page {
    padding: 0;
    min-height: 100vh;
    align-items: stretch;
    background-image:
      radial-gradient(ellipse at 20% 10%, rgba(99,155,255,0.28) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 85%, rgba(37,99,235,0.22) 0%, transparent 50%),
      linear-gradient(160deg, #d6e8ff 0%, #e8f2fb 40%, #f0f6fe 100%);
    background-size: cover;
    background-repeat: no-repeat;
  }
  .login-content {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    align-items: flex-start;
    justify-content: center;
  }
  .login-form-shell {
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .ck-meta-auth .ck-meta-login-box.login-card {
    flex: 1;
    border-radius: 0;
    border: none;
    padding: 32px 24px 40px;
    box-shadow: none;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  /* Franja azul decorativa arriba */
  .ck-meta-auth .ck-meta-login-box.login-card::before {
    content: '';
    display: block;
    height: 4px;
    margin: -32px -24px 28px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  }
  .login-heading h4 { font-size: 24px; }
  .login-brand { margin-bottom: 20px; }
  .login-actions .btn { min-height: 52px; font-size: 15px; }
  .ck-login-page .ck-auth-footer {
    position: static;
    padding: 16px 24px 24px;
    text-align: center;
    background: transparent;
  }
}

/* ======================================================
   REGISTER PAGE – Premium wizard redesign
   ====================================================== */

/* The register page inherits .login-page for background.
   .reg-page just adjusts padding/alignment. */
.reg-page {
  justify-content: flex-end;
  padding: clamp(16px, 2.2vh, 36px) clamp(48px, 5.5vw, 88px) clamp(16px, 2.2vh, 36px) 48px;
}

/* Glass wrapper */
.reg-shell {
  width: 100%;
  max-width: 700px;
  padding: 10px;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(210,230,255,0.10));
}

.reg-form { width: min(100%, 650px); }

/* ── THE CARD – stable fixed height ──────────────────── */
.reg-card {
  width: 100%;
  /* Fixed height so card never jumps between steps */
  height: 720px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background: linear-gradient(158deg, #ffffff 0%, #f5f9ff 100%);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(47, 111, 228, 0.07),
    0 4px 16px rgba(15, 35, 75, 0.07),
    0 32px 80px rgba(15, 35, 75, 0.18);
}

/* ── FIXED HEADER ────────────────────────────────────── */
.reg-card-head {
  flex: 0 0 auto;
  padding: 24px 36px 18px;
  background: #ffffff;
  border-bottom: 1px solid #edf2fb;
}

.reg-brand { display: flex; justify-content: flex-start; margin-bottom: 14px; }
.reg-brand img { width: min(100%, 180px); max-height: 48px; object-fit: contain; }

.reg-heading { margin-bottom: 16px; }
.reg-heading h4 { margin: 0 0 4px; color: #0d1e38; font-size: 22px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.2; }
.reg-heading p  { margin: 0; color: #64748b; font-size: 13px; line-height: 1.4; }

/* ── STEPPER ─────────────────────────────────────────── */
.reg-stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: reg-step;
}

.reg-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  counter-increment: reg-step;
}

/* Circle */
.reg-step::before {
  content: counter(reg-step);
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #d4dfe8;
  background: #f4f8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  transition: all .22s ease;
}

/* Label */
.reg-step > span { font-size: 10.5px; font-weight: 600; color: #94a3b8; text-align: center; transition: color .22s ease; }

/* Connector line (from center of this step to center of next) */
.reg-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #dde8f4;
  z-index: 0;
  transition: background .28s ease;
}

/* Active */
.reg-step.is-active::before {
  border-color: #2563eb;
  background: linear-gradient(135deg, #4b8ef8, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}
.reg-step.is-active > span { color: #2563eb; font-weight: 700; }

/* Complete */
.reg-step.is-complete::before { content: "\2713"; border-color: #16a34a; background: #16a34a; color: #fff; }
.reg-step.is-complete > span  { color: #16a34a; font-weight: 600; }
.reg-step.is-complete:not(:last-child)::after { background: linear-gradient(to right, #16a34a, #22c55e); }

/* ── SCROLLABLE BODY ─────────────────────────────────── */
.reg-card-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 36px 14px;
  scrollbar-width: thin;
  scrollbar-color: #c4d4e8 transparent;
}

.reg-card-body::-webkit-scrollbar { width: 4px; }
.reg-card-body::-webkit-scrollbar-track { background: transparent; }
.reg-card-body::-webkit-scrollbar-thumb { background: #c4d4e8; border-radius: 2px; }

/* ── Step visibility & transition ────────────────────── */
.saas-step { display: none; }

.saas-step.is-visible {
  display: block;
  animation: regStepIn .22s ease;
}

@keyframes regStepIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Section title ───────────────────────────────────── */
.reg-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #eaf1fb;
  color: #2f4a6e;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.065em;
}
.reg-section-title i { color: #3b76e1; font-size: 13px; }

/* ── 2-column field grid ─────────────────────────────── */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.reg-field-wide { grid-column: 1 / -1; }

/* ── Individual field ────────────────────────────────── */
.reg-field { display: flex; flex-direction: column; gap: 6px; }

.reg-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #1a2f4a;
  line-height: 1.2;
}

.reg-field .form-control {
  min-height: 46px;
  border-color: #d7e3ef;
  border-radius: 9px;
  background: #f8fbff;
  font-size: 13.5px;
  color: #1a2f4a;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.reg-field .form-control:focus {
  border-color: #3b76e1;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 118, 225, 0.14);
}

/* ── Timezone preview ────────────────────────────────── */
.reg-timezone-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 8px 12px;
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  color: #64748b;
  font-size: 12px;
}
.reg-timezone-preview i    { color: #3b76e1; font-size: 13px; }
.reg-timezone-preview span { font-weight: 600; }
.reg-timezone-preview strong { margin-left: auto; color: #0d1e38; font-size: 11.5px; font-weight: 800; }

/* ── Review step ─────────────────────────────────────── */
.reg-review {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 24px;
  text-align: center;
  border: 1px solid #d8e8f8;
  border-radius: 14px;
  background: linear-gradient(158deg, #f7faff, #eef5ff);
}
.reg-review i  { color: #16a34a; font-size: 48px; }
.reg-review h5 { margin: 0; color: #0d1e38; font-size: 20px; font-weight: 700; }
.reg-review p  { margin: 0; color: #64748b; font-size: 13.5px; max-width: 360px; }

/* ── FIXED FOOTER ────────────────────────────────────── */
.reg-card-foot {
  flex: 0 0 auto;
  padding: 14px 36px 22px;
  border-top: 1px solid #edf2fb;
  background: linear-gradient(0deg, #fafcff 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Action buttons row */
.reg-actions { display: flex; gap: 10px; }

.reg-actions .btn {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

#prevStep { flex: 0 0 100px; border: 1.5px solid #d0daea; background: #fff; color: #46566d; }
#prevStep:hover:not(:disabled) { border-color: #b0c2d8; background: #f7fbff; }
#prevStep:disabled { opacity: 0.45; cursor: default; }

#nextStep, #submitStep {
  flex: 1;
  border-color: transparent;
  background: linear-gradient(135deg, #4b8ef8 0%, #2563eb 55%, #1d4fd8 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 18px rgba(37,99,235,0.28);
}
#nextStep:hover, #submitStep:hover {
  background: linear-gradient(135deg, #5a97ff 0%, #2f70f0 55%, #2454cc 100%);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 10px 22px rgba(37,99,235,0.36);
}

/* Back to login link */
.reg-back-login {
  display: block;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color .14s ease;
}
.reg-back-login:hover { color: #2563eb; }

.ck-register-page .ck-auth-footer { display: none; }

/* ── Register responsive: tablet / small desktop ─────── */
@media (max-width: 1100px) {
  .reg-page {
    justify-content: center;
    padding: 20px 20px 80px;
    background-image:
      linear-gradient(180deg, rgba(232,241,251,0.46) 0%, rgba(232,241,251,0.76) 42%, rgba(232,241,251,0.97) 100%),
      url("../custom/checkin/bk-login.jpg");
    background-size: cover;
    background-position: center center;
  }
  .reg-shell { max-width: min(96vw, 680px); }
}

/* ── Register responsive: compact viewport height ────── */
@media (max-height: 800px) and (min-width: 641px) {
  .reg-card { height: 660px; }
  .reg-card-head { padding: 18px 32px 14px; }
  .reg-card-body { padding: 16px 32px 12px; }
  .reg-card-foot { padding: 12px 32px 16px; }
  .reg-heading h4 { font-size: 20px; }
  .reg-heading { margin-bottom: 12px; }
  .reg-brand { margin-bottom: 10px; }
  .reg-step::before { width: 24px; height: 24px; font-size: 10px; }
  .reg-step:not(:last-child)::after { top: 12px; }
  .reg-step > span { font-size: 9.5px; }
}

/* ── Register responsive: mobile ─────────────────────── */
@media (max-width: 640px) {
  .reg-page { padding: 12px 10px 70px; }
  .reg-shell { padding: 8px; }
  .reg-card { height: auto; max-height: calc(100vh - 50px); }
  .reg-card-head { padding: 18px 20px 14px; }
  .reg-card-body { padding: 16px 20px 12px; }
  .reg-card-foot { padding: 12px 20px 18px; }
  .reg-grid { grid-template-columns: 1fr; gap: 12px; }
  .reg-heading h4 { font-size: 20px; }
  .reg-stepper { gap: 0; }
  .reg-step > span { font-size: 9px; }
  #prevStep { flex: 0 0 80px; }
}
