* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #ffffff;
    color: #1f1f1f;
    transition: background-color 0.55s ease;
}

body.screen-login {
    background: #e6f0ff;
}

.screen {
    display: flex;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.55s ease, visibility 0.55s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(32, 56, 117, 0.16);
}

.screen-loading {
    background: #ffffff;
}

.loading-wrap {
    width: 100%;
    max-width: 620px;
    padding: 0 16px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(calc(-5vh + 14px));
    opacity: 1;
    transition: opacity 0.55s ease, transform 0.55s ease;
}

#screen1.active .loading-wrap {
    opacity: 1;
    transform: translateY(-5vh);
}

.logo-top {
    width: 100%;
    text-align: center;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 36px;
    letter-spacing: -0.02em;
}

.logo-img {
    display: block;
    width: auto;
    max-width: 180px;
    margin: 0 auto;
    background: transparent;
}

.logo-top .logo-img {
    height: 28px;
}

.logo-login .logo-img {
    height: 24px;
}

.logo-popup .logo-img {
    height: 30px;
}

.card-loading {
    padding: 34px 36px 30px;
    width: 100%;
    text-align: center;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(120, 155, 210, 0.22);
}

.title-main {
    font-size: 22px;
    font-weight: 700;
    color: #1a2233;
    margin-bottom: 14px;
    line-height: 1.35;
}

.subtext {
    font-size: 16px;
    line-height: 1.45;
    color: #7a8494;
}

.card-loading .subtext {
    margin-top: 0;
}

.card-loading .subtext + .subtext {
    margin-top: 8px;
}

.text-img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
}

.card-loading .text-img,
.popup-title .text-img {
    margin-left: auto;
    margin-right: auto;
}

.popup-title-img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.popup-body-img {
    width: 100%;
    max-width: 480px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.popup-multiline-img {
    width: 100%;
    max-width: 480px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.img-h22 { height: 22px; width: auto; }
.img-h16 { height: 16px; width: auto; }
.img-h24 { height: 24px; width: auto; }
.img-h15 { height: 15px; width: auto; }
.img-h18 { height: 18px; width: auto; }
.img-h14 { height: 14px; width: auto; }
.img-h13 { height: 13px; width: auto; }
.img-h12 { height: 12px; width: auto; }

.btn-text-img {
    margin: 0 auto;
    height: 18px;
    width: auto;
}

.session-title-img,
.session-online-img,
.session-name-img,
.session-row-img {
    width: auto;
    max-width: 100%;
}

.session-title-img { height: 10px; }
.session-online-img { height: 11px; }
.session-name-img { height: 15px; }
.session-row-img { height: 12px; }

.support-line {
    margin: 0;
    text-align: center;
    line-height: 1.45;
}

.support-row-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.support-row-bottom {
    display: block;
    margin-top: 6px;
}

.support-prefix-img {
    display: inline-block;
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.support-suffix-img {
    display: block;
    height: 12px;
    width: auto;
    margin: 0 auto;
}

.support-phone {
    display: inline;
    color: #0a68ff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}

.support-phone:hover {
    text-decoration: underline;
}

.popup-title,
.popup-lead,
.popup-text {
    margin-bottom: 0;
}

.popup-title {
    margin: 0 0 14px;
    text-align: center;
}

.popup-lead {
    margin: 0 0 10px;
    text-align: center;
}

.popup-text {
    margin: 0;
    text-align: center;
}

.popup-session-title {
    margin: 0;
}

.popup-session-name {
    margin: 0 0 6px;
}

.popup-session-row + .popup-session-row {
    margin-top: 6px;
}

.dots {
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c8dbf5;
    animation: dotPulse 1.35s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.22s; }
.dot:nth-child(3) { animation-delay: 0.44s; }

@keyframes dotPulse {
    0%, 55%, 100% {
        background: #c8dbf5;
        transform: scale(1);
    }
    28% {
        background: #2f7fd4;
        transform: scale(1.08);
    }
}

.card-login {
    position: relative;
    padding: 32px 30px 24px;
    min-width: 360px;
    max-width: 420px;
    width: 100%;
    min-height: 360px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

#screen2.active .card-login {
    opacity: 1;
    transform: translateY(0);
}

.login-form {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-success {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.card-login.login-success-active .login-form {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.card-login.login-success-active .login-success {
    opacity: 1;
    visibility: visible;
}

.checkmark {
    width: 96px;
    height: 96px;
    display: block;
    overflow: visible;
}

.checkmark-circle {
    stroke: #22c55e;
    stroke-dasharray: 251.33;
    stroke-dashoffset: 251.33;
}

.checkmark-check {
    stroke: #22c55e;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
}

.card-login.login-success-active .checkmark-circle {
    animation: checkmark-circle 0.65s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.card-login.login-success-active .checkmark-check {
    animation: checkmark-check 0.45s cubic-bezier(0.65, 0, 0.35, 1) 0.62s forwards;
}

@keyframes checkmark-circle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmark-check {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
    1% {
        opacity: 1;
    }
    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.logo-login {
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 700;
}

.btn-primary {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    background: #005ff9;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 6px 0 10px;
    line-height: 1.2;
}

.btn-primary:active {
    transform: translateY(1px);
}

body:not(.popup-open) .popup-brand,
body:not(.popup-open) .popup-overlay,
body:not(.popup-open) .support-block {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.popup-open .popup-brand,
body.popup-open .popup-overlay,
body.popup-open .support-block {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.popup-open .popup-overlay .popup-card,
body.popup-open .popup-overlay .popup-session-card {
    opacity: 1;
    visibility: visible;
    transform: none;
}

body.popup-open .screen,
body.popup-open #screen1,
body.popup-open #screen2 {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.popup-open {
    background: #e6f0ff;
}

.popup-brand {
    position: fixed;
    top: 28px;
    left: 50%;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-14px);
    transition: opacity 0.65s ease, transform 0.65s ease, visibility 0.65s ease;
}

.logo-popup {
    text-align: center;
    line-height: 0;
}

.popup-brand.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 96px 20px 20px;
    background: #e6f0ff;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

.popup-overlay .popup-card {
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.65s ease, transform 0.65s ease, visibility 0.65s ease;
}

.popup-overlay.visible .popup-card.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.popup-card {
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(32, 56, 117, 0.16);
    text-align: center;
    padding: 28px 28px 24px;
    pointer-events: auto;
}

.popup-session-card {
    position: relative;
    left: auto;
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(32, 56, 117, 0.14);
    text-align: left;
    padding: 14px 18px 16px;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.65s ease, transform 0.65s ease, visibility 0.65s ease;
}

.popup-session-card.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.popup-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.popup-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.popup-session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.support-block {
    position: fixed;
    bottom: 16px;
    left: 50%;
    z-index: 110;
    width: calc(100% - 32px);
    max-width: 600px;
    margin: 0;
    padding: 18px 22px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    text-align: center;
    line-height: 1.55;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.65s ease, visibility 0.65s ease, transform 0.65s ease;
    transform: translateX(-50%) translateY(12px);
}

.support-block.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.support-block a.support-phone {
    color: #0a68ff;
    font-weight: 600;
    text-decoration: none;
}

.support-block a.support-phone:hover {
    text-decoration: underline;
}

@media screen and (max-width: 600px) {
    .card-login {
        padding: 24px 20px 20px;
        min-width: auto;
    }

    .support-block {
        bottom: 12px;
        width: calc(100% - 24px);
        padding: 14px 16px;
        border-radius: 10px;
    }

    .support-phone {
        font-size: 18px;
    }

    .support-prefix-img {
        height: 18px;
    }

    .support-suffix-img {
        height: 11px;
    }

    .popup-body-img {
        max-width: 100%;
        width: 100%;
    }

    .popup-lead {
        margin-bottom: 12px;
    }

    .popup-text {
        margin-top: 2px;
    }

    .popup-multiline-img {
        max-width: 100%;
    }

    .logo-top .logo-img,
    .logo-popup .logo-img {
        height: 26px;
        max-width: 150px;
    }

    .logo-login .logo-img {
        height: 22px;
        max-width: 130px;
    }

    .popup-overlay {
        padding: 88px 16px 16px;
    }

    .popup-brand {
        top: 16px;
    }

    .popup-card {
        max-width: 92%;
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .popup-session-card {
        max-width: 92%;
        padding: 12px 14px 14px;
        border-radius: 16px;
    }

    .session-title-img { height: 9px; }
    .session-online-img { height: 10px; }
    .session-name-img { height: 14px; }
    .session-row-img { height: 11px; }

    .popup-online-dot {
        width: 7px;
        height: 7px;
    }

    .loading-wrap {
        transform: translateY(calc(-3vh + 10px));
    }

    #screen1.active .loading-wrap {
        transform: translateY(-3vh);
    }

    .screen-loading {
        padding-top: 0;
    }

    .logo-top {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .card-loading {
        padding: 28px 22px 24px;
        border-radius: 18px;
    }

    .title-main {
        margin-bottom: 12px;
    }
}
