/* SSO login page: dark tech look + 2x2 rubik cube animation */
:root {
    --bg: #070b18;
    --accent: #38bdf8;
    --accent-2: #8b5cf6;
    --text: #e6edf7;
    --text-dim: #8b9bb4;
    --line: rgba(148, 163, 184, .18);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    perspective: 1200px;
}

/* ============ background ============ */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    pointer-events: none;
    z-index: 0;
}

.glow-a {
    width: 560px; height: 560px;
    top: -200px; left: -140px;
    background: rgba(56, 189, 248, .20);
    animation: float-a 20s ease-in-out infinite;
}

.glow-b {
    width: 600px; height: 600px;
    right: -220px; bottom: -240px;
    background: rgba(139, 92, 246, .18);
    animation: float-b 26s ease-in-out infinite;
}

@keyframes float-a {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(70px, 50px); }
}

@keyframes float-b {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-80px, -60px); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 76%);
    mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 76%);
}

/* ============ stage ============ */
.stage {
    position: relative;
    z-index: 1;
    width: 520px;
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ rubik ============ */
/* Same as the console login page: fixed camera angle, only JS turns the layers. */
.rubik {
    position: absolute;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transform: rotateX(-28deg) rotateY(32deg);
}

.turn-layer {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .25s ease-in-out;
}

.cubie {
    position: absolute;
    width: 90px;
    height: 90px;
    left: 50%; top: 50%;
    margin: -45px 0 0 -45px;
    transform-style: preserve-3d;
    transition: transform .25s ease-in-out;
}

/* dark sticker: solid face + glowing border */
.sticker {
    position: absolute;
    width: 86px;
    height: 86px;
    margin: 2px;
    border-radius: 8px;
    box-sizing: border-box;
    border: 1px solid rgba(56, 189, 248, .55);
    background: linear-gradient(135deg, #1b2f52, #101a30);
    box-shadow: inset 0 0 18px rgba(56, 189, 248, .18), 0 0 8px rgba(56, 189, 248, .10);
}

.sticker.front  { transform: translateZ(45px); }
.sticker.back   { transform: translateZ(-45px) rotateY(180deg); }
.sticker.right  { transform: translateX(45px) rotateY(90deg); }
.sticker.left   { transform: translateX(-45px) rotateY(-90deg); }
.sticker.top    { transform: translateY(-45px) rotateX(90deg); }
.sticker.bottom { transform: translateY(45px) rotateX(-90deg); }

/* ============ login card ============ */
.login-card {
    position: relative;
    z-index: 2;
    width: 330px;
    padding: 30px 28px 24px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(13, 19, 33, .72);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .55);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
}

.login-card.show {
    opacity: 1;
    transform: translateY(0);
}

/* top sweep highlight */
.card-glow {
    position: absolute;
    top: 0; left: -45%;
    width: 45%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: sweep 7s ease-in-out infinite;
}

@keyframes sweep {
    0%, 100% { left: -45%; }
    50%      { left: 100%; }
}

.brand {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    text-align: center;
    background: linear-gradient(120deg, #e6edf7, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-sub {
    margin: 0 0 24px;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-align: center;
}

/* ============ input ============ */
.field {
    position: relative;
    display: block;
    margin-bottom: 20px;
}

.field input {
    width: 100%;
    height: 40px;
    padding: 6px 2px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: 15px;
    outline: none;
}

.field input::placeholder { color: transparent; }

.field-label {
    position: absolute;
    left: 2px;
    top: 11px;
    font-size: 14px;
    color: var(--text-dim);
    pointer-events: none;
    transition: transform .2s ease, font-size .2s ease, color .2s ease;
}

.field input:focus + .field-label,
.field input:not(:placeholder-shown) + .field-label {
    transform: translateY(-17px);
    font-size: 11px;
    color: var(--accent);
}

.field-line {
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px var(--accent);
    transition: width .28s ease;
}

.field input:focus ~ .field-line { width: 100%; }

/* ============ captcha ============ */
.field-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.field-captcha { flex: 1; }

.captcha-img {
    width: 104px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #0f172a;
    cursor: pointer;
    object-fit: cover;
}

/* ============ options ============ */
.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 20px;
    font-size: 12px;
    color: var(--text-dim);
}

.remember {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.remember input { accent-color: var(--accent); }

.link {
    color: var(--accent);
    text-decoration: none;
}

.link:hover { text-decoration: underline; }

.btn-submit {
    position: relative;
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #06111f;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 6px;
    cursor: pointer;
    transition: transform .15s, box-shadow .25s, filter .25s;
}

.btn-submit span { margin-left: 6px; }

.btn-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 30px rgba(56, 189, 248, .35);
    transform: translateY(-1px);
}

.btn-submit:active { transform: translateY(0); }

.alert {
    margin-bottom: 18px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, .35);
    background: rgba(248, 113, 113, .10);
    color: #fca5a5;
    font-size: 12px;
}

.tip {
    margin: 18px 0 0;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(139, 155, 180, .65);
    text-align: center;
}

/* ============ footer ============ */
.foot {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(139, 155, 180, .55);
}

/* ============ responsive ============ */
@media (max-width: 520px) {
    body {
        perspective: none;
        overflow-y: auto;
    }

    .stage {
        width: 100%;
        height: auto;
        min-height: 560px;
        padding: 40px 18px;
    }

    .rubik {
        width: 200px;
        height: 200px;
        opacity: .5;
        transform: rotateX(-28deg) rotateY(32deg);
    }

    .login-card {
        width: 100%;
        max-width: 340px;
        padding: 26px 22px 20px;
    }

    .brand {
        font-size: 21px;
        letter-spacing: 3px;
    }
}
