.keyclash-login { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Segoe UI', Arial, sans-serif; }
.keyclash-login * { box-sizing: border-box; }
.entry-header { max-width: 1240px; margin: auto; padding: 26px 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.entry-brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-size: 21px; font-weight: 800; letter-spacing: -.7px; text-decoration: none; }
.entry-mark { display: grid; place-content: center; position: relative; width: 39px; height: 39px; border-radius: 12px; background: #244ce4; color: white; font-size: 25px; }
.entry-mark span { position: absolute; bottom: 5px; right: 7px; color: #b4f299; }
.entry-header nav { display: flex; align-items: center; gap: 25px; font-size: 14px; }
.entry-header nav a { color: var(--muted); text-decoration: none; }
.entry-header nav .teacher-link { padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--panel); font-weight: 600; }
.entry-layout { max-width: 1120px; margin: 48px auto 58px; padding: 0 40px; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 80px; }
.entry-eyebrow { color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: 1.6px; display: flex; align-items: center; gap: 10px; }
.entry-eyebrow > span { font-size: 24px; }
.entry-intro h1 { font-size: clamp(44px, 5.1vw, 65px); line-height: 1.06; letter-spacing: -3px; margin: 24px 0; font-weight: 800; }
.entry-intro h1 > span { color: var(--primary); }
.entry-description { color: var(--muted); font-size: 17px; line-height: 1.75; max-width: 370px; }
.keyboard-art { margin: 34px 0; padding: 24px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 14px 40px #244ce40a; max-width: 370px; transform: rotate(-4deg); }
.key-row { display: flex; justify-content: center; gap: 7px; margin: 7px 0; }
.key-row > span { display: grid; place-items: center; width: 43px; height: 39px; border: 1px solid var(--line); border-bottom-width: 4px; border-radius: 8px; background: var(--bg); font-size: 13px; font-weight: 650; }
.key-row > .accent-key { background: #c6f5b5; border-color: #a5d892; color: #244027; }
.key-row > .enter-key { width: 88px; background: #244ce4; color: #fff; border-color: #1839b4; font-size: 12px; }
.rankings-link { max-width: 380px; display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none; padding: 16px 0; }
.rankings-icon { display: grid; place-content: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--primary); font-size: 26px; }
.rankings-link strong { display: block; font-size: 14px; }
.rankings-link small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.rankings-link > span:last-child { margin-left: auto; color: var(--primary); }
.entry-card { padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.student-label { display: inline-block; color: var(--primary); background: var(--bg); padding: 7px 10px; border-radius: 6px; font-size: 10px; letter-spacing: 1.6px; font-weight: 750; }
.entry-card h2 { margin: 21px 0 10px; font-size: 29px; line-height: 1.2; letter-spacing: -1px; }
.entry-subtitle { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 30px; }
.entry-card label { font-size: 13px; font-weight: 650; margin-bottom: 10px; display: block; }
.code-input-wrap { position: relative; }
.entry-card input { width: 100%; height: 54px; margin: 0; padding: 14px 72px 14px 15px; border-radius: 10px; background: var(--bg); font-size: 16px; }
.entry-card .code-toggle { position: absolute; right: 7px; top: 7px; height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; }
.code-help { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 24px; }
.entry-card .entry-submit { display: flex; justify-content: center; align-items: center; gap: 16px; height: 52px; border-radius: 10px; font-size: 15px; }
.entry-help { display: flex; gap: 12px; margin-top: 28px; padding: 20px 0; border-top: 1px solid var(--line); }
.entry-help > span { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 12px; }
.entry-help strong { font-size: 13px; }
.entry-help p { margin: 6px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.entry-admin { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.entry-footer { max-width: 1160px; margin: auto; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; }
.keyclash-login a:focus-visible, .keyclash-login button:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.entry-header a:hover, .entry-admin a:hover, .rankings-link:hover strong { text-decoration: underline; }
@media (max-width: 900px) { .entry-layout { gap: 32px; padding: 0 24px; } .entry-card { padding: 28px; } }
@media (max-width: 680px) { .entry-header { padding: 20px; flex-wrap: wrap; } .entry-header nav { gap: 14px; font-size: 12px; } .entry-brand { font-size: 19px; } .entry-layout { grid-template-columns: 1fr; margin: 20px auto; gap: 24px; padding: 0 20px; max-width: 490px; } .entry-intro h1 { font-size: 44px; letter-spacing: -2px; margin: 15px 0; } .entry-description { font-size: 15px; } .keyboard-art { display: none; } .rankings-link { padding: 8px 0; } .entry-card { padding: 26px; } .entry-footer { padding: 24px 20px; flex-wrap: wrap; } }

/* Text-only ClassForgeHub wordmark, matching the main-page reference. */
.entry-header .entry-brand { display:inline-flex; gap:0; align-items:baseline; font-family:Arial, sans-serif; font-size:23px; font-weight:700; letter-spacing:-.7px; line-height:1.2; white-space:nowrap; color:#17233c; }
.entry-brand .logo-e { color:#dc2626; }
html[data-theme-mode="dark"] .entry-header .entry-brand { color:var(--text); }
html[data-theme-mode="dark"] .entry-brand .logo-e { color:#ff8799; }
.entry-header .entry-brand:hover { text-decoration:none; }
@media(max-width:680px) { .entry-header .entry-brand { font-size:21px; } }

/* Shared sign-in and guest registration card. */
.entry-card { border-radius:22px; padding:36px; box-shadow:0 18px 54px color-mix(in srgb,var(--text) 8%,transparent); }
.auth-switch { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; margin:24px 0; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.auth-switch a { padding:11px 8px; text-align:center; font-size:13px; font-weight:650; border-radius:8px; color:var(--muted); text-decoration:none; }
.auth-switch a[aria-current=page] { color:var(--text); background:var(--panel); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.entry-card input:focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
.guest-invite { display:flex; align-items:center; gap:16px; padding-top:24px; margin-top:26px; border-top:1px solid var(--line); }
.guest-invite strong { font-size:14px; }.guest-invite p { color:var(--muted); font-size:12px; line-height:1.6; margin:6px 0 0; }.guest-invite .btn { white-space:nowrap; font-size:12px; }
.registration-layout { width:min(100% - 40px,510px); margin:32px auto 64px; }.registration-layout h1 { font-size:30px; line-height:1.18; letter-spacing:-1px; margin:20px 0 12px; }.registration-layout input { padding-right:15px; }.registration-layout .entry-submit { font-size:14px; height:auto; min-height:52px; }.auth-note { color:var(--muted); text-align:center; font-size:12px; margin-top:24px; }
@media(max-width:480px){.entry-card { padding:26px; }.guest-invite { flex-direction:column; align-items:stretch; }.guest-invite .btn { text-align:center; }}

/* Stable geometry when switching sign-in and registration. */
.entry-layout { align-items:start; }
.entry-layout .entry-intro { align-self:center; }
.entry-layout .entry-card { min-height:700px; }
.entry-card .entry-subtitle { min-height:48px; }
.entry-card .code-help { min-height:39px; }
.entry-card .entry-submit { min-height:52px; }
.entry-card input[type=email] { padding-right:15px; }
html { scrollbar-gutter:stable; }
@media(max-width:680px) { .entry-layout .entry-intro { align-self:start; } }

/* Match the main index wordmark typography; transforms do not move surrounding layout. */
.entry-header .entry-brand { font-family:'Segoe UI',Arial,sans-serif; font-weight:800; font-size:21px; letter-spacing:-.7px; animation:brand-arrive .7s ease-out both; }
.entry-brand .logo-e { display:inline-block; transform-origin:center bottom; animation:brand-letter 3.6s ease-in-out infinite; }
@keyframes brand-arrive { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes brand-letter { 0%,72%,100% { transform:translateY(0) rotate(0); } 80% { transform:translateY(-5px) rotate(-8deg); } 88% { transform:translateY(0) rotate(5deg); } 94% { transform:translateY(-2px) rotate(0); } }
@media(max-width:680px) { .entry-header .entry-brand { font-size:19px; } }
@media(prefers-reduced-motion:reduce) { .entry-header .entry-brand,.entry-brand .logo-e { animation:none; } }

/* Theme-aware recovery dialog, outside the page layout. */
.recovery-dialog { box-sizing:border-box; width:min(460px,calc(100% - 32px)); max-height:calc(100dvh - 40px); overflow-y:auto; border:1px solid var(--line); border-radius:22px; padding:32px; background:var(--panel); color:var(--text); box-shadow:0 28px 90px rgba(0,0,0,.3); }
.recovery-dialog::backdrop { background:rgba(5,12,24,.62); backdrop-filter:blur(4px); }
.recovery-close { position:absolute; top:12px; right:14px; padding:4px 10px; border:0; border-radius:8px; color:var(--muted); background:transparent; font-size:26px; cursor:pointer; }
.recovery-symbol { display:grid; place-items:center; width:48px; height:48px; margin-bottom:22px; border-radius:14px; background:var(--bg); color:var(--primary); font-size:28px; }
.recovery-dialog h2 { font-size:27px; letter-spacing:-.8px; margin:18px 0 12px; }
.recovery-dialog p { color:var(--muted); font-size:14px; line-height:1.65; }
.recovery-dialog label { display:block; margin:24px 0 9px; font-size:13px; font-weight:650; }
.recovery-dialog input[type=email] { box-sizing:border-box; width:100%; height:52px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; color:var(--text); background:var(--bg); }
.recovery-dialog .recovery-status:empty { display:none; }
.recovery-dialog .recovery-status:not(:empty) { padding:12px; border-radius:10px; background:var(--bg); }
.recovery-dialog .recovery-status.error { color:var(--danger); }.recovery-dialog .recovery-status.success { color:var(--text); }
.recovery-dialog .btn { margin-top:18px; min-height:48px; }.recovery-dialog .btn:disabled { cursor:wait; }
.recovery-back { display:block; margin:18px auto 0; padding:8px; border:0; background:transparent; color:var(--muted); font:inherit; font-size:13px; cursor:pointer; }

.instant-guest-entry{margin-top:24px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--bg)}.instant-guest-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.instant-guest-heading strong{font-size:13px}.instant-guest-heading span{color:var(--muted);font-size:10px}.instant-guest-entry form{margin:0}.instant-guest-entry p{font-size:11px;color:var(--muted);line-height:1.6;margin:10px 0 0}.instant-guest-battle{display:block;margin:10px auto 0;padding:4px;border:0;background:transparent;color:var(--primary);font:inherit;font-size:12px;cursor:pointer}.instant-guest-entry .btn{font-size:13px;min-height:44px}
