/* Custom WordPress Login Page – nutzt dieselben Design-Tokens wie
   Header/Dashboard (siehe assets/css/header.css :root), damit der Login-
   Screen sich nahtlos ins App-Look&Feel einfügt statt eine eigene Palette
   zu fahren. */

body.login {
    background: var(--cv2-bg);
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ── Header bar ──────────────────────────────────────────────────────────── */

body.login::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 68px;
    background: var(--cv2-surface);
    border-bottom: 1px solid var(--cv2-border);
    z-index: 100;
}

body.login .wp-login-logo {
    position: fixed;
    top: 0; left: 48px;
    height: 68px;
    display: flex;
    align-items: center;
    margin: 0; padding: 0;
    text-align: left;
    z-index: 110;
}

body.login .wp-login-logo a {
    background-image: url('https://cocostest.schulverwaltungheimtest.ch/wp-content/uploads/2026/01/cocos-icon.svg') !important;
    background-size: 186px 34px !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
    width: 186px !important;
    height: 68px !important;
    display: block !important;
    overflow: visible !important;
    text-indent: -9999px !important;
    color: transparent !important;
    outline: none;
    /* WP-Core setzt hier standardmäßig margin:0 auto 24px – auf dem
       flex+align-items:center-Container (.wp-login-logo) drückt die 24px
       Margin-Box das Element 12px über den sichtbaren Bereich hinaus. */
    margin: 0 !important;
    transition: opacity .15s ease;
}
body.login .wp-login-logo a:hover { opacity: .85; }

/* ── Main container ──────────────────────────────────────────────────────── */

body.login #login {
    position: fixed;
    top: 68px; left: 0; right: 0; bottom: 0;
    padding: 0 10% 0 52%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: auto;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    /* #login ist selbst position:fixed ohne eigenes z-index (auto) – dadurch
       fängt es SEINE Kinder (u.a. .wp-login-logo mit z-index:110) in einem
       eigenen Stacking-Context, der relativ zur Header-Leiste (z-index:100)
       trotzdem wie "0" zählt. Ohne dieses z-index verschwindet das Logo
       unsichtbar HINTER der Header-Leiste, obwohl sein eigenes z-index höher
       aussieht. */
    z-index: 101;
}

/* ── Amber left panel ────────────────────────────────────────────────────── */

body.login #login::before {
    content: "";
    position: absolute;
    left: 40px; top: 40px; bottom: 40px;
    width: calc(46% - 80px);
    border-radius: var(--cv2-radius-lg);
    box-shadow: var(--cv2-shadow-lg);
    background-color: var(--cv2-accent);
    background-image:
        radial-gradient(circle at 18% 115%, rgba(255, 215, 100, 0.65) 0%, rgba(255, 215, 100, 0.65) 34%, transparent 35%),
        radial-gradient(circle at 80% 112%, rgba(255, 200, 80, 0.5) 0%, rgba(255, 200, 80, 0.5) 26%, transparent 27%);
}

/* ── Form ────────────────────────────────────────────────────────────────── */

#loginform {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 360px;
    margin: 0;
}

/* Überschrift in dunklem Ink statt Amber-auf-Weiß-Text (der lag bei ~1.9:1
   Kontrast, WCAG-Fail) – wie überall sonst im Dashboard (Titel, Avatar-
   Name, …). ::before kommt im normalen Fluss automatisch vor den echten
   Formularfeldern, kein Flex/order-Trick nötig. */
#loginform::before {
    content: "Login";
    display: block;
    color: var(--cv2-ink);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
}

/* ── Labels ──────────────────────────────────────────────────────────────── */

body.login label {
    color: var(--cv2-ink);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */

body.login input[type=text],
body.login input[type=password],
body.login form .input {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--cv2-radius-sm);
    border: 1.5px solid var(--cv2-border-strong);
    padding: 12px 44px 12px 14px;
    background: var(--cv2-surface);
    font-size: 14px;
    color: var(--cv2-ink);
    box-shadow: none;
    margin-bottom: 18px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

body.login input[type=text]:focus,
body.login input[type=password]:focus {
    border-color: var(--cv2-accent);
    box-shadow: 0 0 0 3px var(--cv2-accent-soft);
    outline: none;
}

body.login input[type=text] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B0A898' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

body.login input[type=password] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B0A898' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* ── Remember me ─────────────────────────────────────────────────────────── */

body.login .forgetmenot {
    float: none;
    margin: 0 0 22px 0;
}

body.login .forgetmenot label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--cv2-ink-muted);
    cursor: pointer;
}

body.login input[type=checkbox] {
    -webkit-appearance: none;
    width: 16px;
    min-width: 16px;
    height: 16px;
    border: 1.5px solid var(--cv2-border-strong);
    border-radius: 3px;
    background: var(--cv2-surface);
    cursor: pointer;
    margin: 0;
    transition: background .15s ease, border-color .15s ease;
}

body.login input[type=checkbox]:checked {
    background: var(--cv2-accent);
    border-color: var(--cv2-accent);
}

body.login input[type=checkbox]:checked::before {
    content: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.27 3.5L5.35 9.43 2.73 6.8' stroke='%23241b06' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    display: block;
    margin: -2px 0 0 -3px;
    height: 14px;
    width: 14px;
}

/* ── Submit button ───────────────────────────────────────────────────────── */

body.login .submit {
    margin: 0;
    padding: 0;
}

/* Dunkler Ink-Text statt Weiß auf Amber – derselbe Kontrast-Fix wie bei den
   Header-/Dashboard-Buttons (siehe header.css), sonst einziger Ort im
   Dashboard-Bereich, an dem der WCAG-Fail zurückkäme. */
body.login .button.button-primary {
    background: var(--cv2-accent);
    border: none;
    border-radius: var(--cv2-radius-sm);
    color: var(--cv2-accent-ink);
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 700;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    transition: background .18s ease, transform .15s var(--cv2-ease, ease);
    float: none;
    display: inline-block;
    height: auto;
    line-height: normal;
}

body.login .button.button-primary:hover {
    background: var(--cv2-accent-hover);
    color: var(--cv2-accent-ink);
}
body.login .button.button-primary:active { transform: scale(.97); }

/* ── Nav + Back to blog ──────────────────────────────────────────────────── */

body.login #nav {
    width: 100%;
    max-width: 360px;
    margin-top: 24px;
    padding: 0;
    text-align: left;
}

body.login #nav a {
    color: var(--cv2-ink-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color .15s ease;
}

body.login #nav a:hover {
    color: var(--cv2-accent-hover);
}

body.login #backtoblog {
    display: none;
}

/* ── Hide nocache-bfcache plugin button + popup ───────────────────────────── */

#nocache-bfcache-feature,
#nocache-bfcache-feature-info,
template#nocache-bfcache-feature-button-tmpl + div {
    display: none !important;
}

/* ── Language switcher + Privacy policy ──────────────────────────────────── */
/* Sprachumschalter wird bereits serverseitig unterdrückt (Filter
   login_display_language_dropdown in functions.php, kein Markup im DOM).
   Datenschutz-Link hat keinen entsprechenden Kern-Filter, daher hier per
   CSS entfernt. */
body.login .privacy-policy-page-link {
    display: none !important;
}

body.login .privacy-policy-page-link a {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

body.login .privacy-policy-page-link a:hover {
    color: var(--cv2-accent-hover);
}

/* ── Messages & Errors ───────────────────────────────────────────────────── */

body.login .message,
body.login #login_error {
    width: 100%;
    max-width: 360px;
    border-left: 3px solid var(--cv2-accent);
    background: var(--cv2-surface);
    box-shadow: var(--cv2-shadow-sm);
    border-radius: 4px;
    margin: 0 0 20px 0;
    padding: 12px 16px;
    font-size: 13px;
}

body.login #login_error {
    border-left-color: var(--cv2-danger);
}

/* ── Lost Password form ──────────────────────────────────────────────────── */

#lostpasswordform {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 360px;
    margin: 0;
}

#lostpasswordform::before {
    content: "Passwort vergessen";
    display: block;
    color: var(--cv2-ink);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

#lostpasswordform p {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: var(--cv2-ink-muted);
    line-height: 1.5;
}

body.login input[type=email] {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--cv2-radius-sm);
    border: 1.5px solid var(--cv2-border-strong);
    padding: 12px 44px 12px 14px;
    background: var(--cv2-surface);
    font-size: 14px;
    color: var(--cv2-ink);
    box-shadow: none;
    margin-bottom: 18px;
    transition: border-color .18s ease, box-shadow .18s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B0A898' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

body.login input[type=email]:focus {
    border-color: var(--cv2-accent);
    box-shadow: 0 0 0 3px var(--cv2-accent-soft);
    outline: none;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 840px) {
    body.login #login {
        position: relative;
        top: 68px;
        padding: 40px 24px;
        display: block;
        height: auto;
        min-height: calc(100vh - 68px);
    }

    body.login #login::before {
        display: none;
    }

    #loginform,
    #lostpasswordform,
    body.login #nav,
    body.login .message,
    body.login #login_error {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}
