/* ============================================================
   CamTech POS — Auth pages (login / lockscreen / recovery)
   Two-column presentation from Cameron's design sample
   (tests/camtechpos_login_page_design_sample.html), plain CSS —
   no CDN framework: the shop must be able to sign in with the
   internet down. Shared by index.php, ui/lockscreen.php,
   ui/forgot-password-v2.php, ui/recover-password-v2.php.
   ============================================================ */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.camtech-login {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #1e3a8a 100%);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem 2.5rem;
    align-items: center;
    width: 100%;
    max-width: 72rem;
}

@media (min-width: 992px) {
    .login-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Left column: brand + manifesto --- */
.login-intro {
    max-width: 32rem;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .login-intro { margin: 0; }
}

.login-intro .brand-logo {
    width: 12rem;
    margin-bottom: 3rem;
    display: inline-block;
}

.login-intro h2 {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.2;
    color: #f8fafc;
    margin: 0 0 1.5rem;
}

.login-intro p {
    font-size: 1rem;
    line-height: 1.7;
    color: #e2e8f0;
    margin: 0;
}

.login-intro .tagline {
    font-size: 0.875rem;
    color: #f8fafc;
    margin-top: 3rem;
    opacity: 0.9;
}

/* --- Right column: the card --- */
.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.45);
}

@media (min-width: 768px) {
    .login-card { padding: 2rem; }
}

.login-card h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2.25rem;
}

.login-card .card-subtitle {
    font-size: 0.9rem;
    color: #475569;
    margin: -1.75rem 0 2rem;
    line-height: 1.5;
}

.login-card label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.login-card .field {
    margin-bottom: 1.5rem;
    position: relative;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.login-card input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.login-card input.is-invalid { border-color: #dc2626; }
.login-card .invalid-feedback {
    display: block;
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 0.35rem;
}

.toggle-password {
    position: absolute;
    top: 0;
    right: 0.25rem;
    background: none;
    border: none;
    padding: 0.15rem;
    cursor: pointer;
    color: #94a3b8;
}

.toggle-password svg { display: block; }

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-meta a,
.login-card .quiet-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d4ed8;
    text-decoration: none;
}

.login-meta a:hover,
.login-card .quiet-link:hover { text-decoration: underline; }

.btn-signin {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.025em;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 150ms ease;
}

.btn-signin:hover { background: #1d4ed8; }
.btn-signin:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.btn-signin:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Secondary (ghost) button — e.g. "Send Recovery Code" */
.btn-ghost {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 150ms ease;
}

.btn-ghost:hover { background: #dbeafe; }
.btn-ghost:disabled { opacity: 0.55; cursor: default; }

/* Inline status lines — the anti-modal */
.inline-status {
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    padding: 0.6rem 0.75rem;
    margin-top: 0.75rem;
}

.inline-status.show { display: flex; }

.inline-status.ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.inline-status.err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Server-side error banner (POST validation results) */
.form-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 0.375rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1.25rem;
}

.smart-station-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #64748b;
}

.smart-station-note .atom {
    font-size: 1rem;
    line-height: 1.2;
}

/* Section divider inside a card (recovery steps) */
.step-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.step-divider::before,
.step-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* --- Lockscreen additions --- */
.lock-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.lock-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    background: #f1f5f9;
}

.lock-avatar .who .name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.lock-avatar .who .state {
    font-size: 0.78rem;
    color: #64748b;
}

.lock-shake {
    animation: lock-shake 0.3s;
}

@keyframes lock-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
