:root {
    --lm-bg: #f7f5f3;
    --lm-panel: #ffffff;
    --lm-panel-soft: #fbfaf9;
    --lm-line: #ddd6d0;
    --lm-ink: #261f21;
    --lm-muted: #6f6468;
    --lm-brand: #822433;
    --lm-brand-strong: #641b27;
    --lm-brand-soft: #f3e7e9;
    --lm-accent: #c48a1d;
}

.lm-public-page {
    background:
        linear-gradient(180deg, var(--lm-brand) 0 188px, transparent 188px),
        var(--lm-bg);
    min-height: 100vh;
}

.lm-public-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1160px;
    padding: 24px 28px;
}

.lm-public-brand img {
    display: block;
    height: auto;
    max-width: 232px;
    width: 100%;
}

.lm-public-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.lm-public-actions .lm-language-switcher label {
    color: #fff;
}

.lm-public-actions .lm-language-switcher {
    margin: 0;
    position: relative;
}

.lm-public-actions .lm-language-switcher::after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    content: '';
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-35%);
}

.lm-public-actions .lm-language-switcher select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.12) !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    border-radius: 999px;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700;
    height: 42px !important;
    margin: 0;
    max-width: none !important;
    min-width: 112px;
    padding: 0 38px 0 14px;
    text-align: left;
    text-align-last: auto;
    width: auto !important;
}

.lm-public-actions .lm-language-switcher select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.lm-public-actions .lm-language-switcher select option {
    background: #fff;
    color: var(--lm-ink);
}

.lm-researcher-login {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    text-decoration: none;
}

.lm-researcher-login:hover,
.lm-researcher-login:focus {
    background: #fff;
    color: var(--lm-brand);
    text-decoration: none;
}

.lm-public-abandon-form {
    margin: 0;
}

.lm-public-abandon {
    cursor: pointer;
}

.lm-public-main {
    margin: 0 auto;
    max-width: 1160px;
    padding: 42px 28px 64px;
}

.lm-public-intro {
    background: var(--lm-panel);
    border-top: 5px solid var(--lm-accent);
    box-shadow: 0 16px 42px rgba(36, 31, 33, 0.12);
    margin-bottom: 28px;
    padding: 34px 38px;
    width: 100%;
}

.lm-public-intro h1 {
    color: var(--lm-ink);
    font-size: 36px;
    font-weight: 760;
    line-height: 1.12;
    margin: 0 0 12px;
}

.lm-public-intro p:last-child {
    color: var(--lm-muted);
    font-size: 17px;
    line-height: 1.55;
    margin: 0;
}

.lm-treatment-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lm-treatment-card,
.lm-empty-state {
    background: var(--lm-panel);
    border: 1px solid var(--lm-line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    padding: 24px;
}

.lm-treatment-card {
    box-shadow: 0 8px 24px rgba(36, 31, 33, 0.08);
}

.lm-treatment-card h2,
.lm-empty-state h2 {
    color: var(--lm-brand-strong);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.18;
    margin: 0 0 10px;
}

.lm-treatment-card p {
    color: var(--lm-muted);
    line-height: 1.5;
    margin: 0 0 22px;
}

.lm-treatment-code {
    color: var(--lm-accent);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.lm-treatment-card .btn {
    align-self: flex-start;
}

.lm-empty-state {
    grid-column: 1 / -1;
}

@media (max-width: 680px) {
    .lm-public-page {
        background:
            linear-gradient(180deg, var(--lm-brand) 0 220px, transparent 220px),
            var(--lm-bg);
    }

    .lm-public-header {
        align-items: flex-start;
        gap: 18px;
        padding: 20px;
    }

    .lm-public-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .lm-public-brand img {
        max-width: 190px;
    }

    .lm-researcher-login {
        border-radius: 50%;
        flex: 0 0 42px;
        justify-content: center;
        padding: 0;
        width: 42px;
    }

    .lm-researcher-login span {
        display: none;
    }

    .lm-public-main {
        padding: 24px 20px 42px;
    }

    .lm-public-intro {
        padding: 26px 24px;
    }

    .lm-public-intro h1 {
        font-size: 29px;
    }
}


.lm-public-entry-page {
    background:
        linear-gradient(180deg, var(--lm-brand) 0 210px, transparent 210px),
        var(--lm-bg);
}

.lm-entry-intro {
    margin-bottom: 22px;
}

.lm-entry-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: start;
}

.lm-entry-card,
.lm-entry-sidecard {
    background: var(--lm-panel);
    border: 1px solid var(--lm-line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(36, 31, 33, 0.09);
    padding: 28px;
}

.lm-entry-card-copy h2,
.lm-entry-sidecard h2 {
    color: var(--lm-brand-strong);
    font-size: 28px;
    font-weight: 760;
    line-height: 1.15;
    margin: 0 0 10px;
}

.lm-entry-card-copy p,
.lm-entry-sidecard p,
.lm-entry-note-list {
    color: var(--lm-muted);
    line-height: 1.55;
}

.lm-entry-card-label {
    color: var(--lm-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.lm-entry-id-box {
    align-items: baseline;
    background: #faf7f2;
    border: 1px solid rgba(130, 36, 51, 0.12);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 24px 0 22px;
    padding: 14px 16px;
}

.lm-entry-id-box span {
    color: var(--lm-muted);
    font-size: 13px;
    font-weight: 700;
}

.lm-entry-id-box strong {
    color: var(--lm-brand-strong);
    font-size: 18px;
    letter-spacing: 0.04em;
}

.lm-entry-form {
    display: grid;
    gap: 14px;
}

.lm-entry-field-label {
    color: var(--lm-brand-strong);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.lm-entry-input {
    border: 1px solid rgba(74, 56, 60, 0.18);
    border-radius: 10px;
    min-height: 52px;
    padding: 0 16px;
}

.lm-entry-input:focus {
    border-color: var(--lm-accent);
    box-shadow: 0 0 0 0.18rem rgba(191, 138, 34, 0.18);
}

.lm-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.lm-entry-actions .btn {
    min-height: 46px;
}

.lm-entry-note-list {
    margin: 14px 0 0;
    padding-left: 18px;
}

.lm-entry-note-list li + li {
    margin-top: 10px;
}


.modal-dialog.lm-public-modal-dialog {
    margin: 1.75rem auto;
    max-width: 360px !important;
    width: calc(100% - 32px);
}

.modal-content.lm-public-modal {
    width: 100%;
}

.lm-public-modal {
    border: 1px solid var(--lm-line);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(36, 31, 33, 0.18);
}

.lm-public-modal .modal-header,
.lm-public-modal .modal-footer {
    border-color: var(--lm-line);
}

.lm-public-modal .modal-title {
    color: var(--lm-brand-strong);
    font-size: 18px;
    font-weight: 760;
}

.lm-public-modal .modal-body {
    padding: 16px 20px;
}

.lm-public-modal .modal-body p {
    color: var(--lm-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}

.lm-public-modal .modal-footer {
    padding: 12px 16px 16px;
}

.lm-public-modal .btn {
    min-height: 40px;
}

@media (max-width: 860px) {
    .lm-entry-grid {
        grid-template-columns: 1fr;
    }
}


.lm-entry-instructions-link {
    align-items: center;
    align-self: center;
    background: var(--lm-accent);
    border-color: var(--lm-accent);
    color: #fff;
    display: inline-flex;
    justify-content: center;
    margin-top: 18px;
    text-align: center;
}

.lm-entry-instructions-link:hover,
.lm-entry-instructions-link:focus {
    background: #a87414;
    border-color: #a87414;
    color: #fff;
}

.lm-entry-resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.lm-entry-resource-actions .btn {
    align-items: center;
    flex: 1 1 0;
    gap: 0.45rem;
    justify-content: center;
    min-height: 46px;
    min-width: 0;
    white-space: nowrap;
}

.lm-entry-resource-actions .btn i {
    font-size: 0.95rem;
}

.lm-entry-video-link {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    align-self: center;
    margin-top: 18px;
    text-align: center;
}


.lm-public-header-title {
    flex: 1 1 auto;
    padding: 0 24px;
}

.lm-public-header-title h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 760;
    margin: 0;
    text-align: center;
}

.lm-public-footer {
    border-top: 1px solid rgba(130, 36, 51, 0.14);
    margin-top: 28px;
    padding: 14px 28px 24px;
}

.lm-public-footer-inner {
    align-items: center;
    color: var(--lm-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1160px;
    text-align: center;
}

.lm-public-footer-branding {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: center;
}

.lm-public-footer-logo {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.lm-public-footer-logo--uniroma {
    max-height: 32px;
    width: auto;
}

.lm-public-footer-logo--cimeo {
    border-radius: 3px;
    max-height: 32px;
    width: auto;
}

.lm-public-footer-copyblock {
    display: flex;
    flex-direction: column;
    gap: 1px;
    justify-content: center;
}

.lm-public-footer-title,
.lm-public-footer-copy {
    margin: 0;
}

.lm-public-footer-title {
    color: var(--lm-brand-strong);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
}

.lm-public-footer-copy {
    font-size: 11px;
    line-height: 1.25;
}

.lm-public-page--experiment {
    background:
        linear-gradient(180deg, var(--lm-brand) 0 188px, transparent 188px),
        var(--lm-bg);
    min-height: 100vh;
}

.lm-public-page--experiment .lm-public-header {
    background: transparent;
}

.lm-public-main--experiment {
    padding-top: 28px;
}

.lm-public-page--experiment .otree-body.container {
    background: var(--lm-panel);
    border: 1px solid var(--lm-line);
    border-top: 5px solid var(--lm-accent);
    border-radius: 8px;
    box-shadow: 0 16px 42px rgba(36, 31, 33, 0.12);
    margin: 0 auto 28px;
    max-width: 1160px;
    padding: 30px 34px 36px;
}

.lm-public-page--experiment .otree-title.page-header {
    color: var(--lm-brand-strong);
    margin-bottom: 24px;
}

@media (max-width: 860px) {
    .lm-public-header-title {
        padding: 0;
        width: 100%;
        order: 3;
    }

    .lm-public-header-title h1 {
        font-size: 22px;
        text-align: left;
    }

    .lm-public-footer {
        padding: 14px 20px 20px;
    }

    .lm-public-footer-inner {
        gap: 8px;
    }

    .lm-public-footer-branding {
        gap: 10px;
    }

    .lm-public-page--experiment .otree-body.container {
        padding: 24px 20px 28px;
    }
}


.lm-entry-inline-form {
    display: inline-block;
    margin: 0;
}
