:root {
    --bg: #f3f7fc;
    --panel: #ffffff;
    --text: #183454;
    --muted: #72849a;
    --border: #dce6f1;
    --blue: #1465c0;
    --orange: #f47a32;
}

:root[data-theme="dark"] {
    --bg: #101d30;
    --panel: #192b43;
    --text: #eef5ff;
    --muted: #a7b8cc;
    --border: #354963;
    --blue: #358be8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.hcf-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 44% 56%;
}

.hcf-login-brand {
    background: linear-gradient(145deg, #0753a4, #1679d2);
    color: white;
    padding: 12%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hcf-brand-mark {
    width: 82px;
    height: 82px;
    border-radius: 22px;
    background: white;
    color: #1169bd;
    display: grid;
    place-items: center;
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 35px;
}

.hcf-login-brand h1 {
    font-size: clamp(30px, 3vw, 48px);
    line-height: 1.15;
    margin: 0 0 20px;
}

.hcf-login-brand p {
    font-size: 18px;
    line-height: 1.6;
    opacity: .88;
}

.hcf-brand-accent {
    width: 75px;
    height: 5px;
    background: var(--orange);
    border-radius: 5px;
    margin-top: 24px;
}

.hcf-login-panel {
    background: var(--panel);
    display: flex;
    flex-direction: column;
}

.hcf-login-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 45px;
    font-weight: 700;
}

#theme-toggle {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 22px;
    padding: 10px 18px;
    cursor: pointer;
}

.hcf-login-form {
    width: min(420px, 85%);
    margin: auto;
    padding: 45px 0;
}

.hcf-login-form h2 {
    font-size: 34px;
    margin: 0 0 10px;
}

.hcf-login-form p {
    color: var(--muted);
    margin-bottom: 35px;
}

.hcf-login-form .input {
    margin-bottom: 22px;
}

.hcf-login-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 9px;
}

.hcf-login-form input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 10px;
    font-size: 15px;
}

.hcf-login-form input:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}

.hcf-signin-button {
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 10px;
    background: var(--orange);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

.hcf-signin-button:hover {
    background: #df6824;
}

.hcf-login-footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 30px;
}

.message.error {
    background: #fff0ed;
    color: #a52c20;
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 20px;
}

@media (max-width: 800px) {
    .hcf-login {
        grid-template-columns: 1fr;
    }

    .hcf-login-brand {
        padding: 35px 8%;
    }

    .hcf-brand-mark {
        width: 55px;
        height: 55px;
        font-size: 18px;
        margin-bottom: 18px;
    }

    .hcf-login-brand h1 {
        font-size: 27px;
    }

    .hcf-login-brand p {
        font-size: 15px;
        margin: 0;
    }

    .hcf-brand-accent {
        margin-top: 15px;
    }

    .hcf-login-form {
        padding: 50px 0;
    }

    .hcf-login-top {
        padding: 25px 8%;
    }
}

/* 0.5.2 invitation view: same login theme as HCF Next */
.hcf-invite-page .hcf-login-top strong{color:var(--orange)}
.hcf-invite-page .hcf-invite-security{font-size:12px;color:var(--muted);font-weight:650}
.hcf-invite-page .hcf-invite-hint{font-size:12px;line-height:1.5;margin:-3px 0 15px;color:var(--muted)}
.hcf-invite-page .hcf-login-form{width:100%;max-width:460px}
.hcf-invite-page .hcf-login-form input{width:100%}
.hcf-invite-page .hcf-login-footer{text-align:center}

/* HCF Next 0.6.0 stage A: shared login / registration presentation */
.hcf-auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:5px;background:var(--bg);border:1px solid var(--border);border-radius:12px;margin:0 0 28px}
.hcf-auth-tab{background:transparent;color:var(--muted);border:0;border-radius:9px;padding:12px 8px;font:inherit;font-weight:700;cursor:pointer}
.hcf-auth-tab[aria-selected="true"]{background:var(--panel);color:var(--text);box-shadow:0 2px 8px #142c4617}
.hcf-auth-tab:focus-visible,.hcf-auth-back:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.hcf-login-form [hidden]{display:none!important}
.hcf-register-note{padding:17px 18px;border-radius:11px;background:var(--bg);border:1px solid var(--border);line-height:1.6;font-size:14px;margin-bottom:18px}
.hcf-register-stage{font-size:14px!important;margin-bottom:18px!important}
.hcf-login-form .hcf-signin-button:disabled{opacity:.5;cursor:not-allowed}
.hcf-auth-back{display:block;margin:16px auto 0;border:0;background:transparent;color:var(--blue);font:inherit;font-weight:650;cursor:pointer}

.hcf-company-results{display:grid;gap:4px;margin:8px 0 12px}.hcf-company-option{display:block;text-align:left;padding:10px 12px;border:1px solid #a8b4c6;border-radius:8px;background:transparent;color:inherit;cursor:pointer}.hcf-company-option:hover,.hcf-company-option:focus{border-color:#ef8d31;outline:2px solid #ef8d31}.hcf-honeypot{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}

.hcf-custom-logo{display:block;max-width:240px;max-height:100px;object-fit:contain;margin:0 0 22px}

/* HCF Next 0.6.1 — accessible email verification page */
.hcf-verify-form .hcf-verify-icon { display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;margin:1rem 0;border-radius:50%;background:#e8f5ef;color:#18704b;font-weight:800;font-size:1.5rem; }
.hcf-verify-form .hcf-verify-next { padding:1rem 1.15rem;margin:1rem 0 1.5rem;border:1px solid #d8e2eb;border-radius:12px;background:#f6f9fc;color:#263e53; }
.hcf-verify-form .hcf-verify-next ol { margin:.6rem 0 1rem;padding-left:1.4rem; }
.hcf-verify-form .hcf-verify-next li { margin:.4rem 0; }
.hcf-verify-form .hcf-verify-next p { margin-bottom:0; }
.hcf-verify-form .hcf-verify-back { display:inline-block;margin-top:1rem; }
[data-theme="dark"] .hcf-verify-form .hcf-verify-next { background:#1e3043;color:#e2ebf5;border-color:#3a5167; }

/* HCF Next 0.6.1 Stage G: shared recovery and registration form polish */
.hcf-recovery-page .hcf-recovery-icon{width:56px;height:56px;display:flex;align-items:center;justify-content:center;border-radius:16px;background:var(--bg);color:var(--blue);border:1px solid var(--border);margin-bottom:22px}
.hcf-recovery-page .hcf-recovery-back{margin-top:20px}.hcf-recovery-page .hcf-recovery-hint{font-size:12px;line-height:1.6;color:var(--muted);margin-top:24px}
.hcf-login-form textarea{width:100%;min-height:94px;resize:vertical;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--panel);color:var(--text);font:inherit;box-sizing:border-box}
.hcf-login-form textarea:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
.hcf-login-form .input.checkbox{display:flex;align-items:flex-start;gap:10px;margin:15px 0 18px}
.hcf-login-form .input.checkbox input[type=checkbox]{flex:none;width:18px;height:18px;margin:2px 0 0;accent-color:var(--blue)}
.hcf-login-form .input.checkbox label{font-size:14px;line-height:1.5;margin:0;cursor:pointer}

/* 0.6.1 Stage J — privacy policy acknowledgement */
.hcf-privacy-acceptance{margin:1rem 0;padding:.9rem;border:1px solid #c9d5e0;border-radius:10px;background:rgba(102,135,165,.06)}
.hcf-privacy-label{display:flex;align-items:flex-start;gap:.7rem;line-height:1.5}
.hcf-privacy-label input{flex:none;margin-top:.28rem;accent-color:#24649a}
.hcf-privacy-link{border:0;background:none;padding:0;color:#176aab;text-decoration:underline;cursor:pointer;font:inherit}
.hcf-privacy-modal[hidden]{display:none!important}
.hcf-privacy-modal{position:fixed;inset:0;z-index:10000;background:rgba(9,24,42,.72);display:flex;align-items:center;justify-content:center;padding:1rem}
.hcf-privacy-card{width:min(800px,100%);max-height:94vh;overflow:auto;background:var(--hcf-card-bg,#fff);color:var(--hcf-text,#172b41);border-radius:14px;padding:1.25rem;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.hcf-privacy-header,.hcf-privacy-actions{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.hcf-privacy-header h2{margin:0}.hcf-privacy-header button{font-size:1.7rem;line-height:1;border:0;background:transparent;color:inherit;cursor:pointer}
.hcf-privacy-frame{display:block;width:100%;height:min(48vh,440px);border:1px solid #ccd8e2;border-radius:8px;background:#fff}
.hcf-privacy-confirm{display:flex;gap:.6rem;align-items:center;margin:1rem 0}
.hcf-privacy-actions{justify-content:flex-end;flex-wrap:wrap}.hcf-privacy-actions button{border-radius:8px;padding:.6rem 1rem;cursor:pointer}
#hcf-privacy-accept{background:#196398;color:#fff;border:1px solid #196398}#hcf-privacy-accept:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:600px){.hcf-privacy-card{padding:.85rem}.hcf-privacy-frame{height:43vh}}
