/* BankID login and return pages */
.auth-page { min-height: calc(100vh - 80px); display: flex; align-items: flex-start; justify-content: center; padding: 124px 16px 72px; background: linear-gradient(180deg, rgba(211, 216, 221, 0.25) 0%, rgba(202, 207, 213, 0.25) 100%); font-family: 'Poppins', sans-serif; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #e9e7e2; border-radius: 22px; padding: 32px 28px 24px; box-shadow: 0 1px 2px rgba(32,46,61,.04), 0 16px 40px rgba(32,46,61,.08); text-align: center; animation: auth-rise 260ms cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-head { margin-bottom: 22px; }
.auth-logo { height: 34px; width: auto; margin-bottom: 14px; }
.auth-head h1 { font-family: 'Poppins', sans-serif; font-size: 22px; font-weight: 600; color: #2b2d42; margin: 0 0 6px; letter-spacing: -0.02em; }
.auth-lead { font-size: 14px; color: #6b7280; margin: 0; }

/* Panels: which one shows depends on data-mode */
.auth-panel { display: none; }
.auth-card[data-mode="mobile"] .auth-panel-mobile { display: block; }
.auth-card[data-mode="desktop"] .auth-panel-desktop { display: block; }

/* QR */
.auth-qr { display: inline-block; padding: 12px; background: #fff; border: 1.5px solid #e9e7e2; border-radius: 16px; margin-bottom: 18px; }
.auth-qr-img { display: block; width: 200px; height: 200px; }
.auth-card[data-state="expired"] .auth-qr-img, .auth-card[data-state="error"] .auth-qr-img { opacity: .18; filter: blur(2px); transition: opacity 200ms ease, filter 200ms ease; }
.auth-card[data-state="success"] .auth-qr { border-color: #167a4a; }

.auth-steps { list-style: none; margin: 0 auto; padding: 0; text-align: left; max-width: 300px; display: flex; flex-direction: column; gap: 8px; }
.auth-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #374151; }
.auth-steps li span { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: #2b2d42; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

/* Buttons and links */
.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; padding: 0 24px; border-radius: 999px; border: 0; font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms ease; }
.auth-btn:active { transform: scale(0.97); }
.auth-btn:disabled { opacity: .6; cursor: default; transform: none; }
.auth-btn:focus-visible { outline: 3px solid rgba(255,190,99,.55); outline-offset: 2px; }
.auth-btn-primary { background: #2b2d42; color: #fff !important; }
@media (hover: hover) and (pointer: fine) { .auth-btn-primary:hover { background: #3d405c; } }
.auth-btn-icon { height: 22px; width: auto; filter: brightness(0) invert(1); }
.auth-hint { font-size: 13px; color: #6b7280; margin: 12px 0 0; line-height: 1.5; }
.auth-link { display: inline-block; margin-top: 16px; background: none; border: 0; padding: 6px 0; font-family: inherit; font-size: 13px; color: #6b7280; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-link:hover { color: #2b2d42; }

/* Status line */
.auth-status { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 24px; margin-top: 20px; font-size: 14px; color: #6b7280; }
.auth-status-text { transition: opacity 120ms ease; }
.auth-status-text.is-swapping { opacity: 0; }
.auth-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #e9e7e2; border-top-color: #2b2d42; animation: auth-spin 700ms linear infinite; display: none; }
.auth-check { width: 20px; height: 20px; border-radius: 50%; background: #167a4a; color: #fff; display: none; align-items: center; justify-content: center; }
.auth-check svg { width: 12px; height: 12px; }
.auth-card[data-state="waiting"] .auth-spinner, .auth-card[data-state="opened"] .auth-spinner { display: block; }
.auth-card[data-state="opened"] .auth-status { color: #2b2d42; font-weight: 500; }
.auth-card[data-state="success"] .auth-check { display: inline-flex; }
.auth-card[data-state="success"] .auth-status { color: #167a4a; font-weight: 500; }
.auth-card[data-state="error"] .auth-status, .auth-card[data-state="expired"] .auth-status { display: none; }
.auth-card[data-state="error"] .auth-panel, .auth-card[data-state="expired"] .auth-panel-mobile, .auth-card[data-state="expired"] .auth-steps, .auth-card[data-state="expired"] .auth-link { display: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Errors */
.auth-error { background: #fde8e8; color: #9f1d1d; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 16px 0 14px; text-align: left; }
.auth-error p { margin: 0; max-width: none; }

.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid #e9e7e2; font-size: 13px; color: #6b7280; }
.auth-foot a { color: #2b2d42; font-weight: 600; text-decoration: none; }

@media (max-width: 480px) {
  .auth-page { padding: 104px 12px 48px; align-items: flex-start; }
  .auth-card { padding: 26px 20px 20px; border-radius: 18px; }
  .auth-qr-img { width: 180px; height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
  .auth-btn { transition: none; }
  .auth-btn:active { transform: none; }
}
/* Mobile before the button is pressed: the button says it all */
.auth-card[data-mode="mobile"][data-state="idle"] .auth-status { display: none; }

/* Success: clear the card and draw a checkmark before redirecting */
.auth-card[data-state="success"] .auth-panel,
.auth-card[data-state="success"] .auth-lead,
.auth-card[data-state="success"] .auth-link,
.auth-card[data-state="success"] .auth-error { display: none; }
.auth-card[data-state="success"] .auth-status { flex-direction: column; gap: 16px; margin: 6px 0 4px; padding: 14px 0 10px; font-size: 16px; }
.auth-card[data-state="success"] .auth-check { width: 76px; height: 76px; box-shadow: 0 0 0 0 rgba(22,122,74,.35); animation: auth-pop 460ms cubic-bezier(0.34, 1.56, 0.64, 1) both, auth-ring 900ms ease-out 260ms both; }
.auth-card[data-state="success"] .auth-check svg { width: 38px; height: 38px; }
.auth-card[data-state="success"] .auth-check svg path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: auth-draw 340ms ease-out 280ms forwards; }
.auth-card[data-state="success"] .auth-status-text { animation: auth-rise 320ms ease-out 420ms both; }
@keyframes auth-pop { from { transform: scale(0.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes auth-ring { from { box-shadow: 0 0 0 0 rgba(22,122,74,.35); } to { box-shadow: 0 0 0 18px rgba(22,122,74,0); } }
@keyframes auth-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .auth-card[data-state="success"] .auth-check, .auth-card[data-state="success"] .auth-status-text { animation: none; }
  .auth-card[data-state="success"] .auth-check svg path { animation: none; stroke-dashoffset: 0; }
}
