/* Trang đăng nhập SSO: thẻ tài khoản, bước 2FA, thẻ sự kiện, popup trợ giúp. */

.login-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 16px;
}

.login-layout {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 20px;
}
.login-layout.has-event { max-width: 980px; }
@media (min-width: 900px) {
    .login-layout.has-event { grid-template-columns: 420px minmax(0, 1fr); align-items: stretch; }
}

/* Thẻ đăng nhập */
.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 40px 36px;
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    text-align: center;
}
.auth-card.is-enroll { padding-top: 40px; }

.auth-logo {
    width: 76px;
    height: 76px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2a93f5 0%, #0071e3 100%);
}
.auth-logo.has-image { background: none; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

.auth-glyph {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-text);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: -0.022em;
}
.auth-sub { margin-top: -8px; color: var(--text-2); font-size: 15px; line-height: 1.42; }
.auth-sub .muted { opacity: 0.85; }

.auth-form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* Cụm ô nhập nhãn nổi */
.field-group {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.field { position: relative; }
.field + .field { border-top: 1px solid var(--line); }
.field-input {
    width: 100%;
    height: 56px;
    padding: 22px 16px 6px;
    background: transparent;
    border: 0;
    border-radius: 14px;
    outline: none;
    font-size: 16px;
    text-align: left;
}
.field-input.has-submit { padding-right: 54px; }
.field-input:-webkit-autofill,
.field-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 40px var(--surface) inset;
    caret-color: var(--text);
}
.field-label {
    position: absolute;
    top: 17px;
    left: 16px;
    right: 16px;
    color: var(--text-2);
    font-size: 16px;
    line-height: 22px;
    text-align: left;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.14s ease;
    white-space: nowrap;
}
.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
    transform: translateY(-9px) scale(0.75);
}
.field-input:-webkit-autofill + .field-label {
    transform: translateY(-9px) scale(0.75);
}

.field-otp {
    padding: 8px 54px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 6px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.field-otp::placeholder { color: var(--text-2); opacity: 0.45; }

.field-submit {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hover);
    color: var(--text-2);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.auth-form:valid .field-submit { background: var(--accent); color: #fff; }
.auth-form:valid .field-submit:hover { background: var(--accent-hover); }

.check-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
}
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.auth-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 14px;
}
.link-muted { color: var(--text-2); }
.passkey-status-msg { display: none; font-size: 13px; color: var(--err); line-height: 1.4; }
.passkey-status-msg.is-show { display: block; }

.notice-box { width: 100%; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; }
.waiting-pill {
    padding: 6px 14px;
    border-radius: 980px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
}
.waiting-pill strong { font-weight: 600; }

/* Kích hoạt 2FA bằng QR */
.qr-enroll { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-box { width: 172px; height: 172px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-guide { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.secret-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    background: var(--surface-2);
    border-radius: 12px;
}
.secret-row code { font-size: 12.5px; letter-spacing: 0.04em; word-break: break-all; text-align: left; }

/* Thẻ sự kiện nội bộ */
.event-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.event-media { position: relative; aspect-ratio: 16 / 9; background: #000; flex-shrink: 0; }
.event-media img, .event-media video, .event-media iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.event-media img.is-zoomable { cursor: zoom-in; }
.event-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.28) 100%);
}
.event-play-btn {
    width: 64px;
    height: 64px;
    padding-left: 3px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: #1d1d1f;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease;
}
.event-play:hover .event-play-btn { transform: scale(1.06); }
.event-body { flex: 1; padding: 24px 28px; }
.event-kicker { font-size: 12px; font-weight: 600; color: var(--text-2); }
.event-title {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.016em;
}
.event-desc { margin-top: 8px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.event-body .link { display: inline-block; margin-top: 10px; font-size: 14px; }
.event-notice { padding: 16px 28px 20px; border-top: 1px solid var(--line); }

.event-lightbox {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.86);
    cursor: zoom-out;
}
.event-lightbox.is-open { display: flex; }
.event-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

@media (min-width: 900px) {
    .event-card { max-width: none; }
    .auth-card { max-width: none; }
}

/* Biểu mẫu trong popup trợ giúp */
.form-block { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); }
.choice-list { background: var(--sheet-card); border-radius: 14px; box-shadow: var(--shadow-card); overflow: hidden; }
.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.choice + .choice { border-top: 1px solid var(--line); }
.choice:hover { background: var(--hover); }
.choice input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.choice strong { display: block; font-size: 14px; font-weight: 500; }
.choice small { display: block; font-size: 12.5px; color: var(--text-2); }

@media (max-width: 600px) {
    .login-stage { padding: 20px 16px 8px; align-items: flex-start; }
    .auth-card { padding: 36px 24px 28px; border-radius: 24px; }
    .auth-title { font-size: 25px; }
    .event-card { border-radius: 24px; }
    .event-body { padding: 20px; }
    .event-notice { padding: 14px 20px 18px; }
}
