*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #faeede;
}


/* ── Top banner ── */
.top-banner {
    width: 100%;
    background: linear-gradient(180deg, rgba(10, 24, 44, 0.98), rgba(10, 24, 44, 0.92));
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .top-banner p {
        margin: 0;
        text-align: center;
        font-size: 14px;
        color: rgba(255,255,255,0.88);
        line-height: 1.35;
    }

        .top-banner p a {
            color: #9bdcff;
            font-weight: 700;
            text-decoration: none;
        }

            .top-banner p a:hover {
                text-decoration: underline;
            }


/* Static highlight for "Important Update" */
.update-label {
    display: inline-block;
    margin-right: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 209, 102, 0.18);
    color: #ffd166;
    font-weight: 700;
    letter-spacing: 0.4px;
    border: 1px solid rgba(255, 209, 102, 0.35);
}

/* ── Main layout ── */
.page-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 20px 42px;
    width: 100%;
    overflow-y: auto;
    /* scrollable zone sits between the two fixed bars */
}

/* ── Card entrance animation ── */
@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Card wrapper ── */
.card-border-wrap {
    width: 100%;
    max-width: 340px;
    animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.13);
    width: 100%;
    overflow: hidden;
}

/* ── Card header ── */
.card-header {
    /* Match legacy Site Builder header red (.boldback in Default theme) */
    background: #990000;
    padding: 20px 26px 16px;
    text-align: center;
}

    .card-header .sb-logo {
        display: block;
        margin: 0 auto;
        max-width: 100%;
        height: auto;
    }

/* ── Card body ── */
.card-body {
    padding: 22px 26px 10px;
    background: #ffffff;
}

.signin-label {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin: 0 0 22px;
    font-weight: 500;
}

/* ── Azure button ── */
.btn-azure-wrap {
    display: flex;
    justify-content: center;
}

.btn-azure {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 220px;
    padding: 10px 28px;
    background: #0078d4;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease, opacity 0.2s;
    box-shadow: 0 4px 14px rgba(0,120,212,0.35);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

    .btn-azure:hover {
        background: #106ebe;
        box-shadow: 0 6px 22px rgba(0,120,212,0.48);
        transform: translateY(-2px);
        color: #fff;
        text-decoration: none;
    }

    .btn-azure:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(0,120,212,0.3);
    }

    .btn-azure.loading {
        pointer-events: none;
        opacity: 0.9;
    }

    .btn-azure .btn-text {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.btn-azure-leading {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-azure .btn-spinner {
    display: none;
}

.btn-azure.loading .ms-logo {
    display: none;
}

.btn-azure.loading .btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-azure-leading .spinner-ring {
    width: 16px;
    height: 16px;
    position: static;
}

/* ── Spinner ── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-ring {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

/* ── Ripple on Azure button ── */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: rippleAnim 0.55s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 10px;
    color: #bbb;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #e0e0e0;
    }

/* ── Legacy toggle link ── */
.legacy-toggle {
    display: block;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

    .legacy-toggle:hover {
        color: #0078d4;
        text-decoration: none;
    }

/* ── Sliding panel container ── */
.card-panels {
    overflow: hidden;
    position: relative;
    transition: height 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-panels-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

    .card-panels-track.show-legacy {
        transform: translateX(-100%);
    }

.panel {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
}

/* Collapse legacy panel when hidden so it doesn't add empty space */
.card-panels-track:not(.show-legacy) #panelLegacy {
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}


/* Back button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #0078d4;
    padding: 0 0 14px 0;
    font-family: inherit;
    transition: color 0.15s;
}

    .back-btn:hover {
        color: #005a9e;
    }

    .back-btn svg {
        flex-shrink: 0;
    }

.legacy-panel-title {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin: 0 0 16px;
}

/* ── Legacy form ── */
.legacy-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    margin-bottom: 16px;
    width: 220px;
}

    .form-group input[type="text"],
    .form-group input[type="password"] {
        width: 220px;
        padding: 9px 36px 9px 12px;
        border: 1.5px solid #d0d0d0;
        border-radius: 8px;
        font-size: 14px;
        color: #222;
        background: #fafafa;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
        -webkit-appearance: none;
        appearance: none;
    }

        .form-group input[type="text"]:focus,
        .form-group input[type="password"]:focus {
            border-color: #0078d4;
            box-shadow: 0 0 0 3px rgba(0,120,212,0.13);
            background: #fff;
        }

        .form-group input[type="text"]::-webkit-input-placeholder,
        .form-group input[type="password"]::-webkit-input-placeholder {
            color: #888;
        }

        .form-group input[type="text"]::placeholder,
        .form-group input[type="password"]::placeholder {
            color: #888;
        }

    .form-group input.input-error {
        border-color: #e74c3c;
        box-shadow: 0 0 0 3px rgba(231,76,60,0.12);
    }

/* Eye toggle for password */
.pw-wrap {
    position: relative;
}

.eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #aaa;
    transition: color 0.15s;
    line-height: 0;
}

    .eye-btn:hover {
        color: #0078d4;
    }

/* ── Remember row ── */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #555;
    width: 220px;
}

    .remember-row input[type="checkbox"] {
        accent-color: #0078d4;
        width: 15px;
        height: 15px;
    }

/* ── Log In button ── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    padding: 12px;
    background: #1a3a6b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease, opacity 0.2s;
    position: relative;
    overflow: hidden;
}

    .btn-login:hover:not(:disabled) {
        background: #0f2a55;
        transform: translateY(-1px);
    }

    .btn-login:active {
        transform: translateY(0);
    }

    .btn-login:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

    .btn-login .btn-text {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .btn-login .btn-spinner {
        display: none;
    }

    .btn-login.loading .btn-spinner {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-login .btn-spinner .spinner-ring {
        width: 16px;
        height: 16px;
        position: static;
    }

    .btn-login.loading {
        pointer-events: none;
        opacity: 0.9;
    }

/* ── Error shake ── */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.shake {
    animation: shake 0.4s ease;
}

/* ── Error message ── */
.error-text {
    /* Match legacy error style (Default theme: SPAN.error_message) */
    color: #ff0000;
    font-size: 9pt;
    font-weight: normal;
    margin-top: 10px;
    line-height: 1.4;
    padding: 0 4px;
    text-align: justify;
    text-justify: inter-word;
}

@keyframes errorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-text.visible {
    animation: errorFadeIn 0.22s ease both;
}

.azure-account-error {
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 0 4px;
    min-height: 0;
}

/* keep azure error spacing only; text style comes from .error-text */

/* ── Forgot link ── */
.forgot-link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #0078d4;
    text-decoration: none;
    margin-top: 12px;
    transition: color 0.15s;
}

    .forgot-link:hover {
        color: #005a9e;
        text-decoration: underline;
    }

/* ── Bottom access notice ── */
.bottom-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 24, 44, 0.92), rgba(10, 24, 44, 0.98));
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 8px 20px;
    font-size: 14px;
    line-height: 1.35;
    color: rgba(255,255,255,0.88);
    text-align: center;
}

    .bottom-notice a {
        color: #9bdcff;
        font-weight: 700;
        text-decoration: none;
    }

        .bottom-notice a:hover {
            text-decoration: underline;
        }

    .bottom-notice strong {
        color: #fff;
    }
