/* ==========================================================================
   Soft-TechBd DoctorDesk — sign-in and installer screens
   Standalone pages: no sidebar, no topbar.
   ========================================================================== */

.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 26px 18px;
    background:
        radial-gradient(1100px 520px at 12% -8%, #e2eef1 0%, transparent 62%),
        radial-gradient(900px 460px at 100% 100%, #e8eef6 0%, transparent 58%),
        var(--canvas);
}

.auth-card {
    width: min(920px, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 6px rgba(21, 43, 51, .05), 0 24px 60px rgba(21, 43, 51, .10);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

/* --- Left: identity panel (light, never a dark slab) -------------------- */

.auth-aside {
    background: linear-gradient(160deg, var(--brand-softer) 0%, var(--brand-soft) 100%);
    border-right: 1px solid #d3e6e9;
    padding: 34px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-brand { display: flex; align-items: center; gap: 12px; }

.auth-brand__mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(14, 107, 91, .28);
}
.auth-brand__mark:is(img) {
    object-fit: cover;
    background: #fff;
    padding: 0;
}

.auth-brand__name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--brand-darker);
    line-height: 1.2;
}
.auth-brand__sub { font-size: var(--fs-sm); color: #3f6b73; }

.auth-aside__title {
    font-family: var(--font-display);
    font-size: 23px;
    line-height: 1.32;
    color: var(--brand-darker);
    margin: 0;
    letter-spacing: -.01em;
}

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: #33575e;
    line-height: 1.5;
}
.auth-points .icon { color: var(--brand); flex: 0 0 auto; margin-top: 1px; }

.auth-aside__foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(14, 107, 91, .16);
    font-size: var(--fs-xs);
    color: #4b7680;
    line-height: 1.7;
}
.auth-aside__foot strong { color: var(--brand-darker); }

/* --- Right: the form ---------------------------------------------------- */

.auth-main {
    padding: 34px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.auth-main__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-main__title { margin: 0 0 4px; font-size: var(--fs-xl); }
.auth-main__hint { margin: 0 0 22px; color: var(--muted); font-size: var(--fs-sm); }

.auth-form { display: grid; gap: 15px; }

.remember-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--fs-sm);
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    min-height: 44px;
}
.remember-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--brand);
    cursor: pointer;
}

.auth-field { position: relative; }

.auth-field .input {
    padding: 11px 12px;
    font-size: 15px;
}

.auth-field--password .input { padding-right: 44px; }

.auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.auth-eye:hover { background: var(--surface-sunken); color: var(--ink); }

.auth-lang {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.auth-lang a {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--muted);
}
.auth-lang a:hover { text-decoration: none; color: var(--ink); }
.auth-lang a.is-active { background: var(--paper); color: var(--brand-darker); box-shadow: var(--shadow-xs); }

.auth-foot {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    font-size: var(--fs-xs);
    color: var(--faint);
    text-align: center;
    line-height: 1.7;
}

/* --- Installer ---------------------------------------------------------- */

.setup-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 30px 18px 60px;
    background: var(--canvas);
}

.setup-card {
    width: min(680px, 100%);
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 6px rgba(21, 43, 51, .05), 0 24px 60px rgba(21, 43, 51, .10);
    overflow: hidden;
}

.setup-head {
    padding: 26px 30px 22px;
    background: linear-gradient(160deg, var(--brand-softer), var(--brand-soft));
    border-bottom: 1px solid #d3e6e9;
}
.setup-head__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.setup-head h1 { margin: 0 0 4px; font-size: var(--fs-xl); color: var(--brand-darker); }
.setup-head p { margin: 0; font-size: var(--fs-sm); color: #3f6b73; }

.setup-body { padding: 26px 30px; }
.setup-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }
.setup-steps li {
    display: flex;
    gap: 10px;
    font-size: 13.5px;
    align-items: flex-start;
    color: var(--body);
}
.setup-steps .icon { flex: 0 0 auto; margin-top: 2px; }
.setup-steps .ok { color: var(--success); }
.setup-steps .todo { color: var(--faint); }

.setup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* --- Role-select entry ------------------------------------------------
   Two doors, stacked full-width: logo medal with a per-role ring, title +
   one-line hint, and a chevron. Tokens only, so dark theme follows. */

.role-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    animation: role-rise .3s ease-out both;
}
@keyframes role-rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.role-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.role-card--doctor { border-left-color: var(--brand); }
.role-card--assistant { border-left-color: var(--info); }
.role-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(11, 26, 31, .12);
}
.role-card--doctor:hover { border-color: var(--brand); border-left-color: var(--brand); }
.role-card--assistant:hover { border-color: var(--info); border-left-color: var(--info); }
.role-card:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}
.role-card:active { transform: translateY(0); }

.role-card__medal {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 2px solid var(--line-soft);
    display: grid;
    place-items: center;
}
.role-card--doctor .role-card__medal { border-color: var(--brand-line); }
.role-card--assistant .role-card__medal { border-color: var(--info-border); }
.role-card__photo {
    /* Fixed pixels on purpose: even if an old cached stylesheet without the
       medal frame is applied, the logo can never blow up to natural size. */
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    object-fit: cover;
    display: block;
}
.role-card__fallback {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.role-card__body { display: grid; gap: 3px; min-width: 0; padding-right: 4px; }
.role-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 21px;
    color: var(--ink);
    line-height: 1.3;
}
.role-card--doctor .role-card__title .icon { color: var(--brand); }
.role-card--assistant .role-card__title .icon { color: var(--info); }
.role-card__desc { font-size: var(--fs-sm); color: var(--muted); line-height: 1.55; }
.role-card__go { margin-left: auto; flex: 0 0 auto; color: var(--faint); display: grid; place-items: center; }
.role-card:hover .role-card__go { color: var(--brand); }
.role-card--assistant:hover .role-card__go { color: var(--info); }

/* Chosen-card summary shown above the password form */
.role-current {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 9px 10px 9px 9px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-md);
}
.role-current--assistant { border-left-color: var(--info); }
.role-current__medal {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line-soft);
    display: grid;
    place-items: center;
}
.role-current__medal img { width: 32px; height: 32px; max-width: 32px; object-fit: cover; display: block; }
.role-current__name { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.role-current__change { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .role-grid { animation: none; }
    .role-card, .role-card__arrow { transition: none; }
    .role-card:hover { transform: none; }
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 860px) {
    .auth-card { grid-template-columns: minmax(0, 1fr); }
    .auth-aside {
        border-right: 0;
        border-bottom: 1px solid #d3e6e9;
        padding: 24px 22px;
        gap: 16px;
    }
    .auth-aside__title { font-size: 19px; }
    .auth-points { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
    .auth-aside__foot { margin-top: 12px; }
    .auth-main { padding: 26px 22px; }
}

@media (max-width: 560px) {
    .role-grid { gap: 10px; }
    .role-card { padding: 14px 12px; gap: 12px; }
    .role-card__medal { width: 50px; height: 50px; flex-basis: 50px; border-radius: 14px; }
    .role-card__photo { width: 46px; height: 46px; max-width: 46px; max-height: 46px; }
    .role-current { margin-bottom: 12px; }
    .auth-wrap { padding: 14px 12px; align-items: flex-start; }
    .auth-aside { padding: 16px 14px; gap: 12px; }
    .auth-brand__mark { width: 42px; height: 42px; flex-basis: 42px; font-size: 22px; }
    .auth-brand__name { font-size: 17px; }
    .auth-aside__title { font-size: 17px; }
    .auth-points li { font-size: 13px; }
    .auth-main { padding: 16px 14px; }
    .auth-main__title { font-size: var(--fs-lg); }
    .auth-main__top { margin-bottom: 14px; }
    .auth-main__hint { margin-bottom: 12px; }
    .auth-form { gap: 10px; }
    .auth-foot { margin-top: 14px; padding-top: 12px; }
    .setup-wrap { padding: 14px 12px 24px; }
    .setup-body, .setup-head { padding: 16px 14px; }
    .setup-head__brand { margin-bottom: 10px; }
    .setup-steps { margin-bottom: 14px; }
    .setup-actions { margin-top: 14px; }
}
