/* ShipMind — Maritime Dark UI
   Offline-capable: keine externen CDN-Abhaengigkeiten.
   Farbpalette: ocean navy #0a2540 + teal #06b6d4
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Typography ─────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: #0a2540;
    color: #cbd5e0;
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────────── */
main {
    max-width: 920px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
    background: #061828;
    border-bottom: 2px solid #06b6d4;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-brand { display: flex; flex-direction: column; gap: 0.15rem; }

.header-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #06b6d4;
}

.header-sub {
    font-size: 0.78rem;
    color: #64748b;
    letter-spacing: 0.01em;
}

/* Language toggle */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.lang-btn {
    color: #64748b;
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.lang-btn:hover { color: #e2e8f0; background: #0f3055; }

.lang-btn.active {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.12);
}

.lang-sep { color: #334155; }

/* ── Navigation ─────────────────────────────────────────────── */
nav {
    background: #071e30;
    border-bottom: 1px solid #0e3a55;
    padding: 0 2rem;
    display: flex;
    gap: 0;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.7rem 1.1rem;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
    display: inline-block;
}

nav a:hover { color: #e2e8f0; }

nav a.active {
    color: #06b6d4;
    border-bottom-color: #06b6d4;
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
    background: #0d2d47;
    border: 1px solid #1a4060;
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em;
    background: #06b6d4;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

textarea,
input[type="text"] {
    background: #071e30;
    border: 1.5px solid #1a4060;
    border-radius: 6px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    transition: border-color .15s;
    width: 100%;
}

textarea {
    flex: 1 1 400px;
    resize: vertical;
    min-height: 72px;
    line-height: 1.55;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

textarea::placeholder,
input[type="text"]::placeholder { color: #334155; }

select {
    background: #071e30;
    border: 1.5px solid #1a4060;
    border-radius: 6px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2306b6d4' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

select:focus {
    outline: none;
    border-color: #06b6d4;
}

input[type="file"] {
    font-size: 0.88rem;
    color: #94a3b8;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: #0f3055;
    border: 1px solid #1a4060;
    border-radius: 5px;
    color: #cbd5e0;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: background .15s;
}

input[type="file"]::file-selector-button:hover { background: #1a4060; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #06b6d4;
    color: #061828;
}

.btn-primary:hover { background: #0891b2; }

.btn-secondary {
    background: #0f3055;
    color: #cbd5e0;
    border: 1px solid #1a4060;
}

.btn-secondary:hover { background: #1a4060; }

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: flex-end;
}

/* ── Answer Box ──────────────────────────────────────────────── */
.answer-box {
    background: #071e30;
    border: 1.5px solid #1a4060;
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.answer-box.refused {
    background: #2d0a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* ── Trust Banner ────────────────────────────────────────────── */
.trust-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 1rem;
    line-height: 1.45;
}

.trust-banner.ok {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #065f46;
    color: #6ee7b7;
}

.trust-banner.warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #78350f;
    color: #fcd34d;
}

.trust-banner.refused {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid #7f1d1d;
    color: #fca5a5;
}

.trust-banner-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Confidence ──────────────────────────────────────────────── */
.meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.83rem;
    color: #64748b;
    margin-top: 0.85rem;
}

.confidence-label { font-weight: 600; color: #94a3b8; }

.confidence-bar {
    display: inline-block;
    width: 100px;
    height: 7px;
    background: #0f3055;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .3s;
}

.confidence-fill.high   { background: #10b981; }
.confidence-fill.medium { background: #f59e0b; }
.confidence-fill.low    { background: #ef4444; }

/* ── Sources List ────────────────────────────────────────────── */
.sources-section { margin-top: 1.5rem; }

.sources-section h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.65rem;
}

.sources-list { list-style: none; }

.sources-list li {
    display: grid;
    grid-template-columns: 1.8rem 1fr auto;
    gap: 0.5rem;
    align-items: start;
    padding: 0.55rem 0;
    border-bottom: 1px solid #0f3055;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sources-list li:last-child { border-bottom: none; }

.source-num {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border-radius: 50%;
    width: 1.6em;
    height: 1.6em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.source-info { display: flex; flex-direction: column; gap: 0.2rem; }

.source-name { font-weight: 600; color: #cbd5e0; }

.source-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.badge {
    display: inline-block;
    padding: 0.1em 0.55em;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-manual { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.badge-os     { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.source-dist-bar {
    width: 60px;
    height: 5px;
    background: #0f3055;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.source-dist-fill {
    height: 100%;
    border-radius: 3px;
}

.dist-good   { background: #10b981; }
.dist-medium { background: #f59e0b; }
.dist-poor   { background: #ef4444; }

/* ── Stats (Manuals) ─────────────────────────────────────────── */
.stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat-box {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    padding: 0.85rem 1.4rem;
    text-align: center;
    min-width: 130px;
}

.stat-num {
    font-size: 1.7rem;
    font-weight: 800;
    color: #06b6d4;
    line-height: 1;
}

.stat-lbl {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Doc List ────────────────────────────────────────────────── */
.doc-list { list-style: none; }

.doc-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #0f3055;
    font-size: 0.87rem;
    color: #94a3b8;
    gap: 1rem;
}

.doc-list li:last-child { border-bottom: none; }

.doc-name { color: #cbd5e0; font-weight: 500; word-break: break-word; }

.doc-pages {
    color: #06b6d4;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-size {
    color: #334155;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.no-docs-hint {
    color: #334155;
    font-size: 0.88rem;
    padding: 0.5rem 0;
    font-style: italic;
}

/* ── Upload Form ─────────────────────────────────────────────── */
.upload-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.upload-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.5;
    border-top: 1px solid #0f3055;
    padding-top: 0.75rem;
}

/* ── Flash Messages ──────────────────────────────────────────── */
.flash-list { list-style: none; margin-bottom: 1.25rem; }

.flash-list li {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #065f46;
    color: #6ee7b7;
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid #7f1d1d;
    color: #fca5a5;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #78350f;
    color: #fcd34d;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid #0f3055; margin: 1.25rem 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    header { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.75rem; }
    nav { padding: 0 0.75rem; }
    main { margin: 1.25rem auto; padding: 0 0.75rem; }
    .card { padding: 1.25rem; }
    .form-row { flex-direction: column; }
    .upload-form { flex-direction: column; }
    textarea { flex: none; width: 100%; }
    .form-actions { flex-direction: row; }
}


/* ── Familien-Logo (09.08.2026) — dunkler Kopf: Wortmarke weiss, Anker gold ── */
.familie-logo { display: flex; align-items: center; gap: 10px; }
.familie-anker { flex: none; }
.familie-wortmarke { display: flex; flex-direction: column; line-height: 1.05; }
.familie-wortmarke .haus { font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700; font-size: 1.3rem; color: #fff; letter-spacing: .3px; }
.familie-wortmarke .submarke { font-size: .56rem; font-weight: 600;
    letter-spacing: .26em; text-transform: uppercase; color: #b8860b; margin-top: 3px; }
header { border-bottom-color: #b8860b !important; }
