/* Standalone login surface. Keep portal/framework bundles out of this entry page. */
:root {
    color-scheme: light;
    --ink: #101828;
    --muted: #667085;
    --brand-a: #0d9488;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(125deg, rgba(13, 148, 136, 0.08) 0%, rgba(14, 165, 233, 0.08) 34%, rgba(245, 158, 11, 0.08) 100%),
        radial-gradient(circle at 9% 8%, rgba(13, 148, 136, 0.18), transparent 35%),
        radial-gradient(circle at 92% 15%, rgba(14, 165, 233, 0.16), transparent 36%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(180deg, #f7fafc, #ecf2ff);
    background-size: auto, auto, auto, 24px 24px, 24px 24px, auto;
    min-height: 100vh;
}

h1, h2, p { margin-top: 0; }
p { margin-bottom: 1rem; }
a { color: #0d6efd; text-decoration: underline; }
a:hover { color: #0a58ca; }
button, input, select { margin: 0; font: inherit; }
button, select { text-transform: none; }
button, [type="button"], [type="submit"] { -webkit-appearance: button; }
svg { vertical-align: middle; }
[hidden], .d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.vstack { display: flex; flex: 1 1 auto; flex-direction: column; }
.gap-3 { gap: 1rem !important; }
.w-100 { width: 100% !important; }
.p-4 { padding: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.small, small { font-size: 0.875em; }
.text-secondary { color: var(--muted) !important; }
.text-primary { color: #0d6efd !important; }

/* Retain the existing mobile shell and onboarding appearance without unrelated portal rules. */
.mobile-shell {
    position: relative;
    width: min(100%, 430px);
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: max(32px, env(safe-area-inset-top)) 14px calc(120px + env(safe-area-inset-bottom));
    isolation: isolate;
}

.onboarding-hero {
    padding: 28px;
    margin-bottom: 18px;
    border-radius: 24px;
    color: #f8fafc;
    background: linear-gradient(145deg, #0f3c68, #0f766e 60%, #1d4ed8);
    box-shadow: 0 16px 44px rgba(15, 60, 104, 0.28);
}

.hero-badge, .section-title {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    margin-bottom: 12px;
    font-size: 12px;
}

.onboarding-hero h1 {
    margin-bottom: 10px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: break-word;
    color: #212529;
    border: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    backdrop-filter: blur(4px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover { transform: translateY(-2px); }
.card-body { flex: 1 1 auto; }
.app-card { overflow: hidden; }
.section-desc { color: var(--muted); margin-bottom: 18px; }

.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 0;
    border-radius: 12px;
    overflow-wrap: anywhere;
}
.alert-success { color: #0a3622; background: #d1e7dd; }
.alert-danger { color: #58151c; background: #f8d7da; }
.alert-info { color: #055160; background: #cff4fc; }

.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #212529;
    background: transparent;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-lg { padding: 0.5rem 1rem; font-size: 1.25rem; }
.btn-primary { color: #fff; background: linear-gradient(120deg, #0d9488, #0ea5e9); }
.btn-primary:hover { color: #fff; border-color: #0a58ca; }
.btn-outline-primary { color: #0d6efd; border: 1.5px solid #0d6efd; }
.btn-outline-primary:hover { color: #fff; background: #0d6efd; }
.btn:disabled { pointer-events: none; opacity: 0.65; }
.btn:focus-visible, a:focus-visible { outline: 3px solid #116b79; outline-offset: 3px; }

.form-label { display: inline-block; margin-bottom: 0.5rem; }
.form-control, .form-select {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.375rem 0.75rem;
    border: 1px solid #c7d3e6;
    border-radius: 10px;
    color: #212529;
    background-color: #fff;
    font-weight: 400;
    line-height: 1.5;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control-lg, .form-select-lg { padding: 0.5rem 1rem; font-size: 1.25rem; }
.form-control-lg { min-height: calc(1.5em + 1rem + 2px); }
.form-control::placeholder { color: rgba(33, 37, 41, 0.75); opacity: 1; }
.form-control:disabled, .form-select:disabled { background-color: #e9ecef; opacity: 1; }
.form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-a);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.16);
    outline: 0;
}
.form-check { display: block; min-height: 1.5rem; padding-left: 1.5em; margin-bottom: 0.125rem; }
.form-check-input {
    float: left;
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    margin-left: -1.5em;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background-color: #fff;
    appearance: none;
}
.form-check-input:checked {
    border-color: #0d6efd;
    background-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='%23fff'/%3E%3C/svg%3E");
}
.form-check-input:focus-visible { outline: 3px solid rgba(13, 110, 253, 0.4); outline-offset: 2px; }
.form-check-input:disabled { pointer-events: none; opacity: 0.5; }

/* The invitation variant needs only its summary, not the teacher poster/modal stylesheet. */
.class-invite-login-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px;
    border: 1px solid #dfe3ea;
    border-radius: 12px;
    background: #fff;
}
.class-invite-login-icon {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 10px;
    background: #002fa7;
    color: #fff;
}
.class-invite-login-summary div { display: grid; min-width: 0; gap: 3px; }
.class-invite-login-summary small { color: #667085; }
.class-invite-login-summary strong { color: #101828; font-size: 16px; }
.class-invite-login-summary span { color: #344054; font-size: 12px; line-height: 1.5; }
.class-invite-login-summary .class-invite-login-icon { color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

.login-methods [hidden],
#accountLoginNotice[hidden] {
    display: none !important;
}

.login-method-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin: 18px 0 0;
    background: #edf3f5;
    border-radius: 12px;
}

.login-method-tab {
    min-height: 44px;
    padding: 10px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #607581;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-method-tab[aria-selected="true"] {
    color: #116b79;
    background: #fff;
    box-shadow: 0 1px 4px #163c4a14;
}

.login-method-tab:focus-visible,
.login-methods .wechat-login-action:focus-visible {
    outline: 3px solid #116b79;
    outline-offset: 3px;
}

.wechat-login-panel {
    padding-top: 30px;
    text-align: center;
}

.wechat-login-symbol {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #eaf7ee;
    color: #168546;
    font-size: 34px;
}

.wechat-login-title {
    margin: 18px 0 10px;
    color: #203d4b;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
}

.wechat-login-description,
.wechat-login-hint {
    color: #657985;
    font-size: 14px;
    line-height: 1.7;
}

.login-methods .wechat-login-action {
    margin-top: 12px;
    background: #168546;
    border-color: #168546;
    color: #fff;
    box-shadow: none;
    font-size: 16px;
}

.login-methods .wechat-login-action:hover {
    background: #116c38;
    border-color: #116c38;
    color: #fff;
}

.wechat-login-hint {
    margin: 14px 0 0;
    font-size: 12px;
}

.login-account-description {
    margin-top: 22px;
}
