:root {
    --pos-ink: #102a43;
    --pos-ink-soft: #29475f;
    --pos-blue: #1264a3;
    --pos-blue-dark: #0b4f82;
    --pos-cyan: #27b3c9;
    --pos-teal: #0f9d83;
    --pos-bg: #edf4f7;
    --pos-card: #ffffff;
    --pos-line: #d6e2e8;
    --pos-muted: #6b7f8f;
    --pos-shadow: 0 28px 70px rgba(16, 42, 67, .16);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--pos-ink);
    background:
        radial-gradient(circle at 8% 15%, rgba(39, 179, 201, .16), transparent 34rem),
        linear-gradient(135deg, #f8fbfc 0%, var(--pos-bg) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app-frame {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.app-frame::before {
    content: "";
    position: fixed;
    width: 32rem;
    height: 32rem;
    right: -18rem;
    top: 10%;
    border: 1px solid rgba(18, 100, 163, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 6rem rgba(18, 100, 163, .025), 0 0 0 12rem rgba(18, 100, 163, .02);
    pointer-events: none;
}

.app-header {
    padding: 1.35rem 0;
    position: relative;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: var(--pos-ink);
    text-decoration: none;
}

.brand-mark {
    width: 2.85rem;
    height: 2.85rem;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--pos-ink);
    border-radius: .9rem;
    box-shadow: 0 10px 24px rgba(16, 42, 67, .22);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; line-height: 1.1; letter-spacing: -.01em; }
.brand small { margin-top: .15rem; color: var(--pos-muted); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; }

.connection-status, .install-button {
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem .85rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--pos-ink-soft);
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--pos-line);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.install-button { cursor: pointer; }
.install-button:hover { border-color: var(--pos-blue); color: var(--pos-blue); }

.status-dot {
    width: .55rem;
    height: .55rem;
    background: var(--pos-teal);
    border-radius: 50%;
    box-shadow: 0 0 0 .25rem rgba(15, 157, 131, .12);
}

body.is-offline .status-dot { background: #e79a21; box-shadow: 0 0 0 .25rem rgba(231, 154, 33, .14); }

.login-main { flex: 1; display: flex; align-items: center; position: relative; z-index: 1; }
.min-vh-content { min-height: calc(100vh - 10.5rem); padding: 2rem 0 3rem; }
.intro-content { max-width: 49rem; padding: 1rem 3vw 1rem 0; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.3rem;
    color: var(--pos-blue);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.product-intro h1 {
    max-width: 46rem;
    margin: 0 0 1.4rem;
    color: var(--pos-ink);
    font-size: clamp(3.1rem, 6.2vw, 6.6rem);
    font-weight: 760;
    line-height: .91;
    letter-spacing: -.065em;
}

.product-intro h1 span { display: block; color: var(--pos-blue); }

.intro-lead {
    max-width: 43rem;
    margin: 0;
    color: var(--pos-ink-soft);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
}

.feature-item {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(16, 42, 67, .14);
}

.feature-icon {
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--pos-blue);
    background: rgba(18, 100, 163, .09);
    border-radius: .7rem;
}

.feature-item h2 { margin: 0 0 .25rem; font-size: .9rem; font-weight: 800; }
.feature-item p { margin: 0; color: var(--pos-muted); font-size: .76rem; line-height: 1.45; }

.offline-note {
    max-width: 43rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-top: 1.3rem;
    padding: .85rem 1rem;
    color: #35635b;
    background: rgba(15, 157, 131, .08);
    border: 1px solid rgba(15, 157, 131, .17);
    border-radius: .85rem;
    font-size: .78rem;
    line-height: 1.45;
}

.offline-note > i { color: var(--pos-teal); font-size: 1rem; }

.login-card {
    padding: clamp(1.5rem, 3vw, 2.45rem);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(214, 226, 232, .95);
    border-radius: 1.5rem;
    box-shadow: var(--pos-shadow);
    position: relative;
}

.login-card::before {
    content: "";
    position: absolute;
    height: .3rem;
    left: 2rem;
    right: 2rem;
    top: 0;
    background: var(--pos-cyan);
    border-radius: 0 0 999px 999px;
}

.login-card-header { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.2rem; }

.login-icon {
    width: 3.1rem;
    height: 3.1rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--pos-blue);
    border-radius: .9rem;
    font-size: 1.1rem;
}

.login-kicker { margin: 0 0 .15rem; color: var(--pos-muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-card h2 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.035em; }
.login-copy { margin: 0 0 1.7rem; color: var(--pos-muted); font-size: .9rem; line-height: 1.55; }

.form-label { color: var(--pos-ink-soft); font-size: .78rem; font-weight: 800; }
.input-group-lg > .form-control, .input-group-lg > .input-group-text { min-height: 3.35rem; font-size: .92rem; }
.input-group-text { color: #6e8798; background: #f5f9fa; border-color: var(--pos-line); }
.input-group .form-control { border-color: var(--pos-line); }
.input-group .form-control:focus { border-color: var(--pos-cyan); box-shadow: none; }
.input-group:focus-within { border-radius: .6rem; box-shadow: 0 0 0 .22rem rgba(39, 179, 201, .12); }
.password-toggle { cursor: pointer; }
.password-toggle:hover { color: var(--pos-blue); }
.form-check-label { color: var(--pos-muted); font-size: .76rem; }
.form-check-input:checked { background-color: var(--pos-blue); border-color: var(--pos-blue); }

.secure-label { color: var(--pos-teal); font-size: .7rem; font-weight: 800; }

.login-submit {
    min-height: 3.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    background: var(--pos-blue);
    border-color: var(--pos-blue);
    border-radius: .7rem;
    font-size: .92rem;
    font-weight: 800;
}

.login-submit:hover, .login-submit:focus { background: var(--pos-blue-dark); border-color: var(--pos-blue-dark); }

.form-message {
    margin-top: 1rem;
    padding: .8rem 1rem;
    color: #73510f;
    background: #fff6df;
    border: 1px solid #f2d797;
    border-radius: .7rem;
    font-size: .78rem;
    line-height: 1.45;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    color: var(--pos-muted);
    border-top: 1px solid #e8eff2;
    font-size: .67rem;
}

.login-footer i { color: var(--pos-teal); margin-right: .25rem; }
.app-footer { padding: 1rem 0 1.5rem; color: var(--pos-muted); font-size: .7rem; position: relative; z-index: 1; }

@media (max-width: 991.98px) {
    .min-vh-content { min-height: auto; padding-top: 1rem; }
    .intro-content { max-width: none; padding-right: 0; }
    .product-intro h1 { font-size: clamp(3.3rem, 11vw, 5.5rem); }
    .login-card { max-width: 38rem; margin: 0 auto; }
}

@media (max-width: 575.98px) {
    .app-header { padding: 1rem 0; }
    .brand small { display: none; }
    .connection-status { padding: .65rem; }
    #connectionText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .min-vh-content { padding-bottom: 2rem; }
    .product-intro h1 { font-size: clamp(2.8rem, 16vw, 4.1rem); }
    .intro-lead { font-size: .96rem; }
    .feature-grid { grid-template-columns: 1fr; gap: 0; margin-top: 1.75rem; }
    .feature-item { padding: .75rem 0; }
    .offline-note { align-items: flex-start; }
    .login-card { border-radius: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
