/* bk3d.hu — belépő képernyő. A CostPilot bejelentkező kártyájának átvétele
   (kártya, mezők, betöltés → pipa → üdvözlő animáció), a háttér viszont az
   app saját szürkéje (--page), nem a CostPilot kék gradiense. A színek és a
   betűtípus az app.css tokenjeiből jönnek. */

@keyframes loginFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginSpin { to { transform: rotate(360deg); } }
@keyframes checkPop { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes fillWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0% 0 0); } }
@keyframes frameFade { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.login-screen {
  position: fixed; inset: 0; z-index: 50; min-height: 100vh;
  background: var(--page);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.login-card {
  width: 360px; max-width: 100%; background: #fff; border-radius: 28px; padding: 36px;
  box-shadow: 0 30px 80px rgba(27, 32, 30, .14); animation: loginFadeUp .5s ease; text-align: center;
  margin: auto 0; /* túlcsordulásnál görgethető marad (iOS Safari) */
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -.01em; margin-bottom: 14px; }
.login-logo svg { width: 30px; height: 30px; color: var(--ink); }
.logo-ink { color: var(--ink); }
.logo-accent { color: var(--cobalt); }
.login-sub { font-size: 12.5px; color: var(--graphite); margin-bottom: 26px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-error { font-size: 12px; color: var(--alert); text-align: left; margin-top: -4px; }

.form-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.form-field label { font-size: 12px; color: var(--graphite); font-weight: 600; }
.form-field input {
  width: 100%; border-radius: 14px; border: 1px solid var(--rule); min-height: 0;
  background: #f6f7f5; padding: 10px 14px; font-size: 13.5px; font-family: inherit; color: var(--ink);
}
.form-field input:focus { outline: none; border-color: var(--cobalt); background: #fff; box-shadow: none; }

.btn-primary {
  padding: 11px 20px; border-radius: 999px; border: none; margin-top: 8px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(27, 32, 30, .22); transition: box-shadow .15s, background .15s;
}
.btn-primary:hover { background: #000; box-shadow: 0 10px 24px rgba(27, 32, 30, .32); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.login-stage-center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0; }
.login-spinner {
  width: 36px; height: 36px; border-radius: 999px; border: 3px solid var(--cobalt-soft);
  border-top-color: var(--cobalt); animation: loginSpin .7s linear infinite;
}
.login-check {
  width: 44px; height: 44px; border-radius: 999px; background: var(--cobalt); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
  animation: checkPop .4s ease;
}
.login-stage-text { font-size: 12.5px; color: var(--graphite); }

.login-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule-soft); font-size: 11px; color: var(--graphite); line-height: 1.6; }

.login-welcome {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: var(--page); animation: frameFade .35s ease;
}
.login-welcome-frame {
  border: 2px solid var(--rule-soft); border-radius: 24px; padding: 40px 56px; background: #fff;
  box-shadow: 0 30px 80px rgba(27, 32, 30, .12);
}
.login-welcome-text { position: relative; font-weight: 800; font-size: min(108px, 14vw); letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.login-welcome-ghost { color: #e2e5e3; }
.login-welcome-fill {
  position: absolute; left: 0; top: 0; background: linear-gradient(90deg, var(--ink), var(--cobalt));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  clip-path: inset(0 100% 0 0); animation: fillWipe 1.2s cubic-bezier(.4, 0, .2, 1) forwards;
}

@media (max-width: 420px) {
  .login-screen { padding: 12px; }
  .login-card { padding: 26px 18px; }
  .login-welcome-frame { padding: 28px 30px; }
}
