/* =============================================================================
   barox S/MIME → PEM Konverter – Stylesheet
   Markenfarben (Design-Handbuch): Navy #002D4E, Orange #F7A600
   Schrift: Helvetica Now (lokal eingebunden, keine externen CDN)
   ========================================================================== */

/* ---- Fonts (lokal aus /public/fonts) ------------------------------------ */
@font-face {
    font-family: 'Helvetica Now Text';
    src: url('../fonts/HelveticaNowText-Regular.otf') format('opentype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Helvetica Now Text';
    src: url('../fonts/HelveticaNowText-Medium.otf') format('opentype');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Helvetica Now Text';
    src: url('../fonts/HelveticaNowText-Bold.otf') format('opentype');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Helvetica Now Display';
    src: url('../fonts/HelveticaNowDisplay-Md.otf') format('opentype');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Helvetica Now Display';
    src: url('../fonts/HelveticaNowDisplay-Bd.otf') format('opentype');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Design-Tokens ------------------------------------------------------- */
:root {
    --navy:        #002D4E;
    --navy-700:    #013a63;
    --navy-050:    #eef2f6;
    --orange:      #F7A600;
    --orange-600:  #d98f00;
    --ink:         #14202b;
    --muted:       #5b6b78;
    --line:        #e2e8ee;
    --bg:          #f4f6f9;
    --card:        #ffffff;

    --ok:          #1f8f4e;
    --ok-bg:       #e6f4ec;
    --warn:        #b5710a;
    --warn-bg:     #fdf1dd;
    --err:         #b3261e;
    --err-bg:      #fbe9e7;

    --radius:      14px;
    --radius-sm:   9px;
    --shadow:      0 2px 4px rgba(0,45,78,.05), 0 12px 30px rgba(0,45,78,.07);
    --font:        'Helvetica Now Text', -apple-system, BlinkMacSystemFont,
                   'Segoe UI', Roboto, Arial, sans-serif;
    --font-head:   'Helvetica Now Display', var(--font);
}

* { box-sizing: border-box; }

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

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---- Header -------------------------------------------------------------- */
.site-header {
    background: var(--navy);
    color: #fff;
}
.site-header__inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-header__brand { display: inline-flex; }
.site-header__logo { height: 30px; width: auto; display: block; }
.site-header__tool {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: .95rem;
    letter-spacing: .01em;
    color: #cdd9e4;
}
.site-header__user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .9rem;
}
.site-header__username {
    color: #e6edf3;
    font-weight: 500;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-header__logout {
    color: #cdd9e4;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    padding: 5px 13px;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.site-header__logout:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

/* ---- Layout -------------------------------------------------------------- */
.page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.card--intro { position: relative; overflow: hidden; }
/* Dezenter Markenakzent (Orange) oben an der Intro-Card */
.card--intro::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--orange), var(--orange-600));
}

.card__title {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--navy);
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0 0 12px;
}
.card__subtitle {
    font-family: var(--font-head);
    font-weight: 500;
    color: var(--navy);
    font-size: 1.15rem;
    margin: 0 0 16px;
}
.lead { font-size: 1.02rem; color: var(--ink); margin: 0 0 16px; max-width: 68ch; }

/* ---- Notes / Alerts ------------------------------------------------------ */
.note {
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: .92rem;
    margin: 14px 0 0;
    border: 1px solid transparent;
}
.note--info  { background: var(--navy-050); border-color: #d5e0ea; color: var(--navy-700); }
.note--error { background: var(--err-bg);  border-color: #f2c6c2; color: var(--err); }
.note--warn  { background: var(--warn-bg); border-color: #f0dcb4; color: var(--warn); }

/* ---- Upload / Dropzone --------------------------------------------------- */
.upload { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 40px 24px;
    border: 2px dashed #c3d0dc;
    border-radius: var(--radius);
    background: #fafcfe;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover,
.dropzone:focus-within { border-color: var(--orange); background: #fffdf7; }
.dropzone.is-dragover {
    border-color: var(--orange);
    background: #fff7e6;
    color: var(--navy);
}
.dropzone__input {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
}
.dropzone__icon { color: var(--navy); }
.dropzone.is-dragover .dropzone__icon { color: var(--orange-600); }
.dropzone__text { font-size: 1rem; color: var(--ink); }
.dropzone__text strong { color: var(--navy); }
.dropzone__hint { font-size: .82rem; }
.dropzone__filename {
    margin-top: 6px;
    font-weight: 500;
    color: var(--navy);
    background: var(--navy-050);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .88rem;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 500;
    font-size: .98rem;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--navy); color: #fff; align-self: flex-start; }
.btn--primary:hover { background: var(--navy-700); }
.btn--primary:disabled { background: #9fb2c1; cursor: not-allowed; }
.btn--ghost {
    background: #fff;
    color: var(--navy);
    border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--navy); }
/* Microsoft-365-Anmeldebutton */
.btn--ms { align-self: flex-start; margin-top: 8px; }
.btn--ms svg { display: block; }
.card--login .lead { max-width: 60ch; }

/* ---- Steps --------------------------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .98rem;
}
.steps__num {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.steps em { color: var(--navy); font-style: normal; font-weight: 500; }

/* ---- Summary chips ------------------------------------------------------- */
.summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 22px; }
.chip {
    font-size: .84rem;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
}
.chip--user  { background: var(--ok-bg);   color: var(--ok);   border-color: #bfe3cd; }
.chip--ca    { background: var(--navy-050); color: var(--navy-700); border-color: #d5e0ea; }
.chip--muted { background: #f1f3f5; color: var(--muted); }

/* ---- Cert table ---------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 720px;
}
.cert-table thead th {
    background: var(--navy);
    color: #fff;
    font-weight: 500;
    text-align: left;
    padding: 12px 14px;
    font-size: .82rem;
    letter-spacing: .02em;
    white-space: nowrap;
}
.cert-table tbody td {
    padding: 13px 14px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}
.cert-table tbody tr:hover { background: #f9fbfd; }
.cert-table tbody tr.is-expired { background: #fdf6f5; }
.cert-table tbody tr.is-expired:hover { background: #fbeceb; }
.cert-table__check { width: 44px; text-align: center; }
.cert-table__detailcol { width: 92px; }

.cert-subject { font-weight: 500; color: var(--navy); word-break: break-word; }
.cert-email {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--muted);
    font-size: .85rem;
    word-break: break-all;
}
.cert-email svg { flex: 0 0 auto; color: var(--orange-600); }

.cert-validity { white-space: nowrap; color: var(--ink); }
.cert-validity .lbl { color: var(--muted); display: inline-block; width: 26px; }

/* Checkboxen in Markenfarbe */
input[type="checkbox"] { accent-color: var(--navy); width: 17px; height: 17px; cursor: pointer; }

/* ---- Badges -------------------------------------------------------------- */
.badge {
    display: inline-block;
    font-size: .74rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    margin: 0 3px 3px 0;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge--user    { background: var(--ok-bg);   color: var(--ok);       border-color: #bfe3cd; }
.badge--ca      { background: var(--navy-050); color: var(--navy-700); border-color: #d5e0ea; }
.badge--muted   { background: #f1f3f5;         color: var(--muted); }
.badge--expired { background: var(--err-bg);   color: var(--err);      border-color: #f2c6c2; }
.badge--warn    { background: var(--warn-bg);  color: var(--warn);     border-color: #f0dcb4; }

/* ---- Details ------------------------------------------------------------- */
details > summary {
    cursor: pointer;
    color: var(--navy);
    font-weight: 500;
    font-size: .85rem;
    user-select: none;
}
details[open] > summary { margin-bottom: 8px; }
.cert-detail { margin: 0; font-size: .82rem; }
.cert-detail dt { color: var(--muted); font-weight: 500; margin-top: 6px; }
.cert-detail dd { margin: 2px 0 0; word-break: break-word; }
.mono {
    font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace;
    font-size: .78rem;
    letter-spacing: .01em;
    word-break: break-all;
}

/* ---- Actions ------------------------------------------------------------- */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 22px;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}
.site-footer__inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 640px) {
    .card { padding: 22px; }
    .card__title { font-size: 1.4rem; }
    .site-header__tool { display: none; }
    .actions { justify-content: stretch; }
    .actions .btn { flex: 1; }
}
