* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body.app-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(165deg, #071f33 0%, #1E4B70 38%, #2563eb 100%);
    color: #111;
    -webkit-font-smoothing: antialiased;
}
body.app-login-page {
    position: relative;
    overflow-x: hidden;
}
.login-bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.login-bg-glow--top {
    top: -120px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
}
.login-bg-glow--bottom {
    bottom: 40px;
    left: -100px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(37,99,235,0.22) 0%, transparent 70%);
}
.login-page-stack {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-features-panel {
    width: 100%;
    border-radius: 18px;
    padding: 14px 0 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 30px rgba(7, 31, 51, 0.18);
}
.login-features-kicker {
    margin: 0 0 10px;
    padding: 0 16px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.login-features-ticker-viewport {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.login-features-ticker-track {
    display: flex;
    align-items: center;
    width: max-content;
    flex-wrap: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.login-features-ticker-track.is-ready {
    opacity: 1;
}
.login-features-ticker-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    padding: 2px 12px;
}
.login-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}
.login-feature-chip i {
    font-size: 0.68rem;
    color: #bfdbfe;
}
.login-feature-dot {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.55rem;
    line-height: 1;
    flex-shrink: 0;
}
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 32px;
    position: relative;
    z-index: 1;
}
.app-shell--login {
    padding: calc(24px + env(safe-area-inset-top, 0)) 16px calc(24px + env(safe-area-inset-bottom, 0));
}
.app-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 28px 22px;
    box-shadow: 0 20px 50px rgba(7, 31, 51, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.65);
}
.login-card {
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1E4B70 0%, #2563eb 50%, #38bdf8 100%);
}
.login-brand {
    margin-bottom: 4px;
}
.app-logo-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 22px;
    background: linear-gradient(145deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 24px rgba(30, 75, 112, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.app-logo-img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.app-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #1E4B70;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}
.app-title {
    text-align: center;
    color: #1E4B70;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.app-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 22px;
    line-height: 1.45;
}
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1E4B70;
    margin-bottom: 5px;
}
.field input, .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: #f9fafb;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: #1E4B70;
    background: #fff;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1E4B70 0%, #2563eb 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(30, 75, 112, 0.28);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 24px rgba(30, 75, 112, 0.34);
}
.btn-primary:active:not(:disabled) { transform: scale(0.98); }.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #eef2f7;
    color: #1E4B70;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}
.link-row {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #6b7280;
}
.link-row a { color: #1E4B70; font-weight: 700; text-decoration: none; }
.error-box {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.45;
}
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
}
.chip.selected {
    border-color: #1E4B70;
    background: #eef4fa;
    color: #1E4B70;
}
.wizard-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}
.wizard-progress > div {
    height: 100%;
    background: #1E4B70;
    transition: width 0.25s ease;
}
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-nav {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.wizard-nav .btn-primary, .wizard-nav .btn-secondary { flex: 1; margin-top: 0; }
.check-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #374151;
}
.check-row input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.check-row a { color: #1E4B70; font-weight: 700; }
.install-hint {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    margin: 0 0 16px;
    text-align: center;
}
#pwa-install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.install-overlay-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px 22px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.install-overlay-card h2 {
    margin: 0 0 8px;
    color: #1E4B70;
    font-size: 1.25rem;
}
.install-overlay-card p {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.45;
}
.install-overlay-card .btn-primary,
.install-overlay-card .btn-secondary { margin-top: 8px; }
.install-status {
    font-size: 12px;
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: 10px;
    margin: 0 0 12px;
    text-align: center;
}
.install-status.ok { background: #ecfdf5; color: #166534; }
.install-status.warn { background: #fffbeb; color: #92400e; }
.install-status.error { background: #fef2f2; color: #b91c1c; }
.install-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.install-modal-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px 20px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.install-modal-card h3 {
    margin: 0 0 10px;
    color: #1E4B70;
}
.install-modal-card p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}
/* Legacy #pwa-install-bar styles removed – see /app/css/pwa-install-bar.css */

/* Welcome / onboarding screen */
html:has(body.app-welcome-page) {
    overflow: hidden;
    height: 100%;
}
body.app-welcome-page {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
}
body.app-welcome-page .login-bg-glow {
    display: none;
}
.app-shell--welcome {
    justify-content: center;
    align-items: center;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: calc(10px + env(safe-area-inset-top, 0)) 20px calc(10px + env(safe-area-inset-bottom, 0));
    gap: 0;
}
.welcome-content {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex-shrink: 1;
    min-height: 0;
}
.welcome-showcase {
    width: 100%;
    flex-shrink: 1;
    min-height: 0;
}
.welcome-phones {
    position: relative;
    height: clamp(140px, 30vh, 230px);
    margin: 0 auto;
    max-width: 360px;
}
.welcome-phone {
    position: absolute;
    bottom: 0;
    width: 38%;
    max-width: 150px;
    height: auto;
    max-height: 100%;
    border-radius: 20px;
    box-shadow: none;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
.welcome-phone--left {
    left: 2%;
    transform: rotate(-10deg) translateY(14px) scale(0.9);
    z-index: 1;
}
.welcome-phone--center {
    left: 50%;
    width: 44%;
    max-width: 172px;
    transform: translateX(-50%) translateY(-6px);
    z-index: 3;
}
.welcome-phone--right {
    right: 2%;
    transform: rotate(10deg) translateY(14px) scale(0.9);
    z-index: 2;
}
.welcome-copy {
    text-align: center;
    width: 100%;
    padding: 0 4px;
    flex-shrink: 0;
}
.welcome-headline {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    font-weight: 900;
    line-height: 1.28;
    letter-spacing: -0.02em;
}
.welcome-subtext {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.88rem, 3.4vw, 1.02rem);
    line-height: 1.5;
    font-weight: 500;
}
.welcome-actions {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.btn-primary--welcome {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    margin-top: 0;
    border-radius: 999px;
    padding: 15px 20px;
    font-size: 1rem;
}
.btn-secondary--welcome {
    display: inline-block;
    width: auto;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.78rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
}
.btn-secondary--welcome:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Registration wizard */
body.app-register-page {
    overflow-x: hidden;
}
.app-shell--register {
    min-height: 100dvh;
    padding: calc(12px + env(safe-area-inset-top, 0)) 16px calc(16px + env(safe-area-inset-bottom, 0));
    justify-content: center;
    align-items: center;
}
.register-stack {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.register-card {
    width: 100%;
    padding: 22px 20px 20px;
}
.wizard-lottie-wrap {
    width: 100%;
    height: clamp(150px, 24vh, 190px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex-shrink: 0;
}
.wizard-lottie-wrap.is-hidden {
    display: none;
}
.wizard-lottie {
    width: 100%;
    max-width: 280px;
    height: clamp(150px, 24vh, 190px);
}
.wizard-lottie svg {
    max-width: 100%;
    max-height: 100%;
}
.wizard-hint {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    line-height: 1.45;
}
.register-card .app-title {
    font-size: 1.3rem;
    margin-bottom: 4px;
}
.register-card .app-subtitle {
    margin-bottom: 14px;
}
.register-card .wizard-progress {
    margin-bottom: 14px;
}
.register-card .wizard-step p {
    margin-top: 0;
}
@media (prefers-reduced-motion: reduce) {
    .wizard-lottie-wrap {
        display: none !important;
    }
}
