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

html, body {
    height: 100%;
    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;
    inset: 0;
    height: 100%;
    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: min(620px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(calc(-5vh + 14px));
    opacity: 0;
    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: clamp(28px, 6vh, 48px);
    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;
}

.card-loading .subtext {
    margin-top: 0;
    font-size: 16px;
    line-height: 1.45;
    color: #7a8494;
}

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

.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;
    inset: 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: 1;
    stroke-dashoffset: 1;
    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.42s cubic-bezier(0.65, 0, 0.35, 1) 0.62s forwards;
}

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

@keyframes checkmark-check {
    0% {
        stroke-dashoffset: 1;
        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: 10px 14px;
    border-radius: 8px;
    border: none;
    background: #005ff9;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 6px 0 10px;
}

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

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

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

.popup-brand {
    position: fixed;
    top: clamp(20px, 5vh, 40px);
    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;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: clamp(88px, 14vh, 120px) 20px 20px;
    background: transparent;
    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: 18px 20px 20px;
    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: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1f9d55;
    flex-shrink: 0;
}

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

.popup-title {
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
    text-align: center;
}

.popup-lead {
    font-size: 16px;
    line-height: 1.5;
    color: #374151;
    margin: 0 0 10px;
    text-align: center;
}

.popup-text {
    font-size: 15px;
    line-height: 1.5;
    color: #6b7280;
    margin: 0;
    text-align: center;
}

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

.popup-session-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.popup-session-name {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.popup-session-row {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
}

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

.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;
    font-size: 18px;
    color: #111;
    line-height: 1.5;
    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 {
    color: #0a68ff;
    font-weight: 600;
    text-decoration: none;
}

.support-block a: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;
        font-size: 15px;
        line-height: 1.4;
        border-radius: 10px;
    }

    .support-block a {
        font-size: 16px;
    }

    .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: clamp(80px, 13vh, 108px) 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: 16px 16px 18px;
        border-radius: 16px;
    }

    .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 {
        font-size: 19px;
    }

    .card-loading .subtext {
        font-size: 15px;
    }

    .popup-title {
        font-size: 20px;
    }

    .popup-lead {
        font-size: 15px;
    }

    .popup-text {
        font-size: 14px;
    }
}
