/* RedHandFist Zertifikatsverwaltung */

:root {
    --red: #c00000;
    --red-dark: #8b0000;
    --black: #0b0b0b;
    --panel: #171717;
    --panel-2: #202020;
    --line: #343434;
    --white: #ffffff;
    --light: #d8d8d8;
    --muted: #a9a9a9;
    --gold: #c59b42;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgba(192,0,0,.13), transparent 30%),
        #0b0b0b;
    color: var(--light);
    font-family: Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; }

.app-body { min-height: 100vh; }

.app-container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(8,8,8,.98);
    border-bottom: 1px solid #242424;
}

.header-inner {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.header-logo {
    width: 220px;
    height: auto;
    display: block;
}

.app-header nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.app-header nav a {
    padding: 11px 17px;
    border: 1px solid #444;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.app-header nav a:hover { border-color: var(--red); }

.app-header .logout-link { border-color: var(--red); }

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.login-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(145deg, #1b1b1b, #111);
    box-shadow: var(--shadow);
}

.login-card {
    width: min(520px, 100%);
    padding: 42px;
}

.app-logo {
    width: 220px;
    height: auto;
    margin-bottom: 34px;
}

.eyebrow {
    display: block;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1 {
    margin: 10px 0 12px;
    color: var(--white);
    font-size: clamp(38px, 5vw, 62px);
    line-height: .95;
    letter-spacing: .02em;
}

.lead {
    margin: 0 0 28px;
    color: #cfcfcf;
    line-height: 1.7;
}

.page-space { padding: 58px 0 72px; }

.panel { padding: clamp(26px, 4vw, 48px); }

.form-grid,
.certificate-form {
    display: grid;
    gap: 22px;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

label {
    display: grid;
    gap: 9px;
}

label > span {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid #454545;
    border-radius: 12px;
    outline: none;
    background: #0e0e0e;
    color: #fff;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197,155,66,.12);
}

.primary-button,
.secondary-button,
.mail-button {
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--red);
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.primary-button,
.mail-button {
    background: linear-gradient(110deg, #9c0000, #df0000);
}

.primary-button:hover,
.mail-button:hover { background: var(--red-dark); }

.secondary-button {
    background: #262626;
    border-color: #555;
}

.secondary-button:hover { border-color: var(--red); }

.info-box,
.message {
    padding: 16px 18px;
    border-radius: 12px;
    line-height: 1.55;
}

.info-box {
    border-left: 4px solid var(--gold);
    background: rgba(197,155,66,.08);
    color: #ddd;
}

.message { margin: 18px 0; }

.message.error {
    border: 1px solid rgba(220,0,0,.55);
    background: rgba(192,0,0,.10);
}

.message.success {
    border: 1px solid rgba(46,156,70,.55);
    background: rgba(46,156,70,.10);
}

.summary-grid {
    margin: 28px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.summary-grid > div {
    padding: 16px;
    border: 1px solid #353535;
    border-radius: 14px;
    background: #111;
}

.summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.summary-grid strong {
    display: block;
    margin-top: 7px;
    color: #fff;
    line-height: 1.35;
}

.pdf-preview {
    height: min(72vh, 760px);
    min-height: 520px;
    overflow: hidden;
    border: 1px solid #404040;
    border-radius: 16px;
    background: #555;
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #777;
}

.action-row {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-form { margin: 0; }

.print-frame-hidden {
    position: fixed;
    left: -99999px;
    top: -99999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

@media (max-width: 820px) {
    .two-cols,
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .pdf-preview {
        min-height: 430px;
    }
}

@media (max-width: 560px) {
    .login-card { padding: 28px 22px; }

    .two-cols,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .app-header nav {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .app-header nav a { text-align: center; }

    .action-row {
        flex-direction: column;
    }

    .primary-button,
    .secondary-button,
    .mail-button,
    .inline-form {
        width: 100%;
    }
}
