html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
.msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}

.msg-arrow {
    opacity: 0.6;
}

.msg-time {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.6;
}

.msg-text {
    font-size: 14px;
    line-height: 1.4;
}
/* ===============================
   BOARD PANEL (contenitore scrollabile)
================================= */

#boardPanel {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* importante */
}

/* area messaggi scrollabile */
#boardMessages {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

/* messaggi singoli */
.board-message {
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

    .board-message:hover {
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }


.thread-message {
    position: relative;
    padding: 8px 10px;
    margin: 4px 0;
    border-left: 2px solid #ddd;
    cursor: pointer;
    transition: background 0.2s;
}

    .thread-message:hover {
        background: #f7f7f7;
    }

.thread-children {
    margin-left: 20px;
    border-left: 1px dashed #ccc;
    padding-left: 10px;
}

.collapse-toggle {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    margin-left: 5px;
}

.collapsed > .thread-children {
    display: none;
}

.collapsed > .msg-header::after {
    content: " [+]";
    color: #888;
}

.msg-header::after {
    content: " [-]";
    color: #888;
}
/* Move down content because we have a fixed navbar that is 50px tall */
body {
    padding-top: 50px;
    padding-bottom: 20px;
}

/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
    max-width: 280px;
}


/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
    .jumbotron {
        margin-top: 20px;
    }

    .body-content {
        padding: 0;
    }
}

:root {
    --bg: #f5f5f7;
    --bg-alt: #ffffff;
    --border: #e2e2e7;
    --primary: #2563eb;
    --primary-soft: #e0ecff;
    --accent: #0f172a;
    --danger: #dc2626;
    --text: #111827;
    --muted: #6b7280;
    --radius: 14px;
    --shadow-soft: 0 14px 40px rgba(15,23,42,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(245,245,247,0.9);
    border-bottom: 1px solid rgba(226,232,240,0.9);
}

.nav {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 20%, #ffffff 0, #dbeafe 40%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(37,99,235,0.25);
    font-size: 16px;
    font-weight: 700;
    color: #1d4ed8;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

    .brand-text span:first-child {
        font-weight: 600;
        letter-spacing: 0.02em;
        font-size: 15px;
    }

    .brand-text span:last-child {
        font-size: 11px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.16em;
    }

.nav-links {
    display: flex;
    gap: 18px;
    font-size: 14px;
}

    .nav-links a {
        color: var(--muted);
        text-decoration: none;
        padding: 6px 10px;
        border-radius: 999px;
        transition: background 0.15s ease, color 0.15s ease;
    }

        .nav-links a:hover {
            background: #e5e7eb;
            color: var(--text);
        }

.nav-cta {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
}

main {
    flex: 1;
}

.hero {
    max-width: 1040px;
    margin: 26px auto 0;
    padding: 0 18px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 26px;
    align-items: stretch;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
}

.hero-title {
    font-size: clamp(30px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

    .hero-title span {
        color: #1d4ed8;
    }

.hero-subtitle {
    color: var(--muted);
    font-size: 14px;
    max-width: 520px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

    .hero-meta span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 9px;
        border-radius: 999px;
        background: #e5e7eb;
    }

        .hero-meta span strong {
            color: var(--text);
            font-weight: 500;
        }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.btn-primary,
.btn-ghost {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: box-shadow 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(37,99,235,0.35);
}

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(37,99,235,0.45);
    }

.btn-ghost {
    background: #ffffff;
    color: var(--muted);
    border: 1px solid #e5e7eb;
}

    .btn-ghost:hover {
        background: #f3f4f6;
        color: var(--text);
    }

.hero-right {
    position: relative;
}

.card {
    position: relative;
    height: 100%;
    min-height: 240px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-sub {
    font-size: 12px;
    color: var(--muted);
}

.card-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

    .card-body ul {
        list-style: none;
        margin-top: 6px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 10px;
    }

    .card-body li span {
        color: var(--text);
        font-weight: 500;
    }

.section {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 18px 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
}

.section-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

.panel {
    border-radius: 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 14px 14px 12px;
    box-shadow: var(--shadow-soft);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 10px;
}

.panel-title {
    font-size: 14px;
    font-weight: 500;
}

.panel-tag {
    font-size: 11px;
    color: var(--muted);
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f9fafb;
}

.panel-body {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

    .panel-body ul {
        list-style: none;
        margin-top: 6px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 10px;
    }

    .panel-body li span {
        color: var(--text);
        font-weight: 500;
    }

/* CHAT */

.chat-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 320px;
}

.chat-log {
    flex: 1;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    padding: 10px;
    overflow-y: auto;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg {
    max-width: 80%;
    padding: 7px 9px;
    border-radius: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

    .msg.me {
        align-self: flex-end;
        background: #2563eb;
        color: #ffffff;
        border-bottom-right-radius: 2px;
    }

    .msg.other {
        align-self: flex-start;
        background: #e5e7eb;
        color: var(--text);
        border-bottom-left-radius: 2px;
    }

.msg-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

.msg-enc {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
    word-break: break-all;
}

.chat-input-row {
    display: flex;
    gap: 6px;
}

    .chat-input-row input[type="text"] {
        flex: 1;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: #f9fafb;
        color: var(--text);
        padding: 7px 10px;
        font-size: 13px;
        outline: none;
    }

        .chat-input-row input[type="text"]::placeholder {
            color: var(--muted);
        }

    .chat-input-row button {
        border-radius: 999px;
        border: none;
        padding: 7px 12px;
        font-size: 13px;
        cursor: pointer;
        background: #111827;
        color: #f9fafb;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

        .chat-input-row button:hover {
            filter: brightness(1.05);
        }

.chat-key-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    align-items: center;
}

    .chat-key-row input[type="password"] {
        flex: 1;
        min-width: 120px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: #f9fafb;
        color: var(--text);
        padding: 5px 9px;
        font-size: 11px;
        outline: none;
    }

    .chat-key-row button {
        border-radius: 999px;
        border: none;
        padding: 5px 10px;
        font-size: 11px;
        cursor: pointer;
        background: #ffffff;
        color: var(--muted);
        border: 1px solid var(--border);
    }

.chat-status {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

    .chat-status span {
        color: #1d4ed8;
    }

footer {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    background: #f9fafb;
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 18px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
}

    .footer-inner a {
        color: #2563eb;
        text-decoration: none;
    }

        .footer-inner a:hover {
            text-decoration: underline;
        }

@media (max-width: 880px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-right {
        order: -1;
    }

    .grid-two {
        grid-template-columns: minmax(0, 1fr);
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 520px) {
    .panel-body ul,
    .card-body ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .chat-shell {
        height: 280px;
    }
}
textarea {
    height: 600px;
    box-sizing: border-box;
    resize: horizontal;
    width: 600px;
}