/* CS Mobile — guest auth (login / password / passkey)
   Light Business Central-inspired workspace */

:root {
    --app-bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --brand: #e30613;
    --brand-hover: #c9000c;
    --brand-soft: #fff1f2;
    --brand-border: #fecdd3;
    --primary: var(--brand);
    --primary-hover: var(--brand-hover);
    --primary-soft: var(--brand-soft);
    --primary-border: var(--brand-border);
    --accent: var(--brand);
    --text-primary: #172033;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #dfe4ea;
    --danger: #d92d20;
    --success: #16875b;
    --radius-sm: 6px;
    --radius-md: 9px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --cs-red: var(--brand);
    --cs-white: var(--surface);
    --cs-muted: var(--text-secondary);
    --cs-border: var(--border);
    --cs-black: var(--text-primary);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", "Noto Sans Armenian", system-ui, sans-serif;
    background: var(--app-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: calc(0.65rem + var(--safe-top)) 1.25rem 0.65rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text-primary); }
.brand em { font-style: normal; color: var(--primary); }
.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

.content {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 1.25rem 1rem calc(1.5rem + var(--safe-bottom));
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.auth-error-page {
    text-align: center;
    max-width: 440px;
}
.auth-error-page .code {
    display: inline-block;
    min-width: 3.5rem;
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}
.auth-error-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.auth-brand-mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
    overflow: hidden;
}
.auth-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    border: 0;
    background: var(--primary);
    color: #fff;
    font-weight: 650;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--primary-hover); }
.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { min-height: 40px; padding: 0.4rem 0.75rem; font-size: 0.88rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.9rem; }
.field label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.field input {
    min-height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
}
.field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

.error { color: var(--danger); font-size: 0.88rem; margin: 0.35rem 0; }
.muted { color: var(--text-secondary); }

:where(a, button, input):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

.auth-login-shell {
    width: min(1180px, 100%);
    min-height: min(720px, calc(100vh - 150px));
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.11);
}

.auth-showcase {
    position: relative;
    isolation: isolate;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2.25rem, 5vw, 4.5rem);
    color: #fff;
    background:
        radial-gradient(circle at 90% 85%, rgba(255,255,255,.2), transparent 34%),
        linear-gradient(145deg, #b9000d 0%, #e30613 58%, #ff4d57 100%);
}

.auth-showcase::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: 0.16;
    background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.auth-showcase-copy { position: relative; z-index: 2; max-width: 31rem; }
.auth-eyebrow {
    display: inline-flex;
    margin-bottom: 1.5rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-showcase h1,
.auth-showcase-title {
    max-width: 28rem;
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
}
.auth-showcase p:not(.auth-showcase-title) {
    max-width: 29rem;
    margin: 1.25rem 0 0;
    color: rgba(255,255,255,.84);
    font-size: 1rem;
    line-height: 1.65;
}
.auth-features {
    display: grid;
    gap: 0.65rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,255,255,.93);
    font-size: 0.9rem;
}
.auth-showcase-illustration {
    position: absolute;
    right: -3.5rem;
    bottom: -4rem;
    width: min(62%, 430px);
    height: auto;
    opacity: 0.34;
    filter: drop-shadow(0 24px 30px rgba(69, 0, 5, .28));
    transform: rotate(-4deg);
}

.auth-form-column {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 4rem);
}
.auth-form-column .auth-card {
    max-width: 420px;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
}
.auth-form-column .auth-brand-mark { width: 64px; height: 64px; }
.auth-form-column .card h1 {
    font-size: 1.75rem;
    letter-spacing: -0.025em;
}
.auth-form-column .field { margin-bottom: 1rem; }
.auth-form-column .field input { min-height: 48px; border-radius: 8px; }
.auth-form-column .btn {
    min-height: 48px;
    border-radius: 8px;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.auth-form-column .btn:hover { transform: translateY(-1px); }

@media (max-width: 820px) {
    .topbar { padding-inline: 1rem; }
    .content { align-items: stretch; padding: 1rem; }
    .auth-login-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 14px;
    }
    .auth-showcase {
        min-height: 210px;
        padding: 1.5rem;
    }
    .auth-showcase h1,
    .auth-showcase-title { font-size: 1.65rem; max-width: 22rem; }
    .auth-showcase p:not(.auth-showcase-title) { margin-top: 0.7rem; font-size: 0.88rem; }
    .auth-features { display: none; }
    .auth-showcase-illustration { width: 210px; right: -2rem; bottom: -4rem; opacity: .26; }
    .auth-form-column { padding: 1.5rem; }
}
