/**
 * protect_public.css
 *
 * Layout und Styling für das öffentliche Portal-Passwort-Gate.
 */

@font-face {
    font-family: "Helvetica Neue LT Pro";
    src: url("../fonts/HelveticaNeueLTPro_normal_normal_300.woff") format("woff");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --hb-red: #e2001a;
    --hb-text: #0f172a;
    --hb-muted: #475569;
    --hb-border: rgba(15, 23, 42, 0.10);
    --hb-font-base: "Helvetica Neue LT Pro", Arial, Helvetica, "Microsoft YaHei", "SimSun", "Noto Sans CJK SC", "Noto Sans JP", "Noto Sans KR", sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--hb-text);
    font-family: var(--hb-font-base);
    font-weight: 300;
}

button,
input,
select,
textarea {
    font: inherit;
    font-family: var(--hb-font-base);
}

/* Passwortkarte */
.guard-card {
    width: 100%;
    max-width: 460px;
    padding: 28px 24px 22px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

/* Logo */
.guard-logo {
    margin-bottom: 18px;
    text-align: center;
}

.guard-logo img {
    display: inline-block;
    width: 100%;
    max-width: 280px;
    height: auto;
}

/* Textbereich */
.guard-card h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 5vw, 34px);
    line-height: 1.15;
    text-align: center;
}

.guard-sub {
    margin: 0 0 22px;
    color: var(--hb-muted);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

/* Formular */
.guard-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guard-card label {
    font-size: 14px;
    font-weight: 700;
}

.guard-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: var(--hb-text);
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guard-card input[type="password"]:focus {
    border-color: var(--hb-red);
    box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.12);
    outline: none;
}

/* Absenden */
.guard-card button[type="submit"] {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    appearance: none;
    background: var(--hb-red);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.guard-card button[type="submit"]:hover {
    filter: brightness(0.95);
}

.guard-card button[type="submit"]:active {
    transform: translateY(1px);
}

.guard-card button[type="submit"]:focus-visible {
    outline: 3px solid rgba(226, 0, 26, 0.35);
    outline-offset: 2px;
}

/* Fehler und Meta */
.guard-error {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.4;
}

.guard-meta {
    margin-top: 18px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* Sprachwahl */
.guard-lang {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
}

.guard-lang details {
    position: relative;
}

.guard-lang summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--hb-border);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.guard-lang summary::-webkit-details-marker {
    display: none;
}

.guard-lang .globe {
    font-size: 16px;
    line-height: 1;
}

.guard-lang .code {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.guard-lang .caret {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.guard-lang details[open] summary {
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.guard-lang .menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    padding: 6px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--hb-border);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.guard-lang .item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--hb-text);
    text-decoration: none;
}

.guard-lang .item:hover {
    background: rgba(15, 23, 42, 0.04);
}

.guard-lang .item.is-active {
    background: rgba(226, 0, 26, 0.06);
}

.guard-lang .left {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.guard-lang .native,
.guard-lang .right {
    font-weight: 800;
}

.guard-lang .name {
    font-size: 12px;
    opacity: 0.75;
}

.guard-lang .right {
    opacity: 0.75;
}

.guard-lang .item.is-active .right {
    opacity: 1;
}

/* Mobile Darstellung */
@media (max-width: 640px) {
    body {
        align-items: flex-start;
        padding: 16px;
    }

    .guard-card {
        margin-top: 90px;
        padding: 24px 18px 20px;
        border-radius: 18px;
    }

    .guard-logo img {
        max-width: 220px;
    }

    .guard-lang {
        top: 10px;
        right: 10px;
    }

    .guard-lang .menu {
        min-width: min(220px, calc(100vw - 20px));
    }
}