/* Nòduls · Objectius d’aprenentatge per SA */

.sa-objectives {
    margin-top: 32px;
    padding-top: 30px;
    border-top: 1px solid rgba(195, 203, 222, 0.12);
}

.sa-objectives__header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: end;
}

.sa-objectives__eyebrow {
    color: #aaa5ff;
    font-size: 0.61rem;
    font-weight: 760;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sa-objectives__header h3 {
    margin: 10px 0 0;
    color: #f4f1eb;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.sa-objectives__header p {
    max-width: 700px;
    margin: 13px 0 0;
    color: #929db1;
    font-size: 0.77rem;
    line-height: 1.65;
}

.sa-objectives__actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}

.sa-objectives__actions button,
.sa-objectives__footer button {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(188, 198, 220, 0.15);
    border-radius: 2px;
    color: #d7dbe5;
    background: rgba(5, 12, 23, 0.34);
    font: inherit;
    font-size: 0.64rem;
    white-space: nowrap;
    cursor: pointer;
}

.sa-objectives__actions button:hover,
.sa-objectives__footer button:hover {
    border-color: rgba(164, 157, 246, 0.38);
    background: rgba(126, 121, 225, 0.08);
}

.sa-objectives__actions button.is-primary {
    border-color: rgba(167, 160, 248, 0.34);
    color: #f0efff;
    background: rgba(126, 121, 225, 0.15);
}

.sa-objectives__actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sa-objectives__message {
    margin-top: 23px;
    padding: 24px;
    border: 1px solid rgba(195, 203, 222, 0.12);
    color: #8994a8;
    background: rgba(7, 15, 28, 0.34);
    font-size: 0.72rem;
    text-align: center;
}

.sa-objectives__message.is-warning {
    border-color: rgba(225, 179, 116, 0.22);
    color: #d1b588;
    background: rgba(145, 99, 35, 0.055);
}

.sa-objectives__message[hidden],
.sa-objectives__workspace[hidden],
.sa-objectives__empty[hidden] {
    display: none;
}

.sa-objectives__metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 23px;
    border-top: 1px solid rgba(195, 203, 222, 0.12);
    border-bottom: 1px solid rgba(195, 203, 222, 0.12);
}

.sa-objectives__metrics > div {
    padding: 15px 16px 15px 0;
}

.sa-objectives__metrics > div + div {
    padding-left: 16px;
    border-left: 1px solid rgba(195, 203, 222, 0.12);
}

.sa-objectives__metrics span {
    display: block;
    color: #748097;
    font-size: 0.58rem;
    font-weight: 720;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.sa-objectives__metrics strong {
    display: block;
    margin-top: 7px;
    color: #eceaf2;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: 1.34rem;
    font-weight: 500;
}

.sa-objectives__notice {
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 2px solid #c58d62;
    color: #c9a681;
    background: rgba(160, 104, 59, 0.055);
    font-size: 0.65rem;
    line-height: 1.5;
}

.sa-objectives__notice.is-ready {
    border-left-color: #72b899;
    color: #9fd2ba;
    background: rgba(80, 157, 122, 0.06);
}

.sa-objectives__list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.sa-objective-card {
    padding: 19px;
    border: 1px solid rgba(195, 203, 222, 0.12);
    border-radius: 2px;
    background:
        linear-gradient(
            135deg,
            rgba(18, 31, 51, 0.56),
            rgba(9, 18, 32, 0.48)
        );
}

.sa-objective-card > header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(195, 203, 222, 0.09);
}

.sa-objective-card > header > div:first-child {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sa-objective-card > header span {
    color: #aaa5ff;
    font-size: 0.61rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sa-objective-card > header strong {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid rgba(225, 179, 116, 0.22);
    border-radius: 999px;
    color: #d1b588;
    background: rgba(145, 99, 35, 0.055);
    font-size: 0.56rem;
}

.sa-objective-card > header strong.is-ready {
    border-color: rgba(114, 184, 153, 0.28);
    color: #9fd2ba;
    background: rgba(80, 157, 122, 0.06);
}

.sa-objective-card__controls {
    display: flex;
    gap: 6px;
}

.sa-objective-card__controls button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(188, 198, 220, 0.13);
    border-radius: 2px;
    color: #b7c0cf;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.sa-objective-card__controls button:hover {
    border-color: rgba(164, 157, 246, 0.36);
    background: rgba(126, 121, 225, 0.08);
}

.sa-objective-card__controls button.is-danger:hover {
    border-color: rgba(218, 115, 127, 0.36);
    color: #e2a0a9;
    background: rgba(172, 62, 77, 0.08);
}

.sa-objective-card__controls button:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.sa-objective-card__text {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.sa-objective-card__text > span {
    color: #bdc4d0;
    font-size: 0.64rem;
    font-weight: 680;
}

.sa-objective-card__text textarea {
    width: 100%;
    min-height: 92px;
    box-sizing: border-box;
    resize: vertical;
    padding: 12px 13px;
    border: 1px solid rgba(188, 198, 220, 0.14);
    border-radius: 2px;
    outline: none;
    color: #eef0f4;
    background: rgba(5, 12, 23, 0.46);
    font: inherit;
    font-size: 0.71rem;
    line-height: 1.55;
}

.sa-objective-card__text textarea:focus {
    border-color: rgba(159, 151, 245, 0.68);
    box-shadow:
        0 0 0 3px rgba(141, 136, 242, 0.08),
        inset 3px 0 0 rgba(154, 146, 244, 0.65);
}

.sa-objective-card__alignment {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.sa-objective-card__alignment details {
    border: 1px solid rgba(195, 203, 222, 0.1);
    border-radius: 2px;
    background: rgba(5, 12, 23, 0.25);
}

.sa-objective-card__alignment summary {
    display: flex;
    justify-content: space-between;
    gap: 13px;
    align-items: center;
    min-height: 43px;
    padding: 0 12px;
    color: #cfd4dd;
    font-size: 0.64rem;
    cursor: pointer;
    list-style: none;
}

.sa-objective-card__alignment summary::-webkit-details-marker {
    display: none;
}

.sa-objective-card__alignment summary::before {
    content: "+";
    color: #aaa5ff;
    font-size: 0.8rem;
}

.sa-objective-card__alignment details[open] summary::before {
    content: "−";
}

.sa-objective-card__alignment summary > span {
    margin-right: auto;
}

.sa-objective-card__alignment summary strong {
    color: #858fa2;
    font-size: 0.57rem;
    font-weight: 660;
}

.sa-objective-card__options {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow-y: auto;
    padding: 0 10px 10px;
    scrollbar-width: thin;
}

.sa-objective-option {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(195, 203, 222, 0.08);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.012);
    cursor: pointer;
}

.sa-objective-option:hover {
    border-color: rgba(171, 165, 248, 0.24);
}

.sa-objective-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sa-objective-option > span:first-of-type {
    width: 17px;
    height: 17px;
    box-sizing: border-box;
    border: 1px solid rgba(190, 199, 220, 0.25);
    border-radius: 2px;
    background: rgba(5, 12, 23, 0.45);
}

.sa-objective-option input:checked + span {
    border-color: #aaa5ff;
    box-shadow: inset 0 0 0 4px #817bdc;
}

.sa-objective-option > span:last-of-type {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.sa-objective-option strong {
    color: #b9b4ff;
    font-size: 0.58rem;
}

.sa-objective-option small {
    display: -webkit-box;
    overflow: hidden;
    color: #9ca6b9;
    font-size: 0.6rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.sa-objective-card__option-empty {
    margin: 0;
    padding: 12px;
    color: #707c91;
    font-size: 0.6rem;
    text-align: center;
}

.sa-objectives__empty {
    margin-top: 18px;
    padding: 28px;
    border: 1px dashed rgba(195, 203, 222, 0.12);
    color: #788398;
    text-align: center;
}

.sa-objectives__empty strong {
    color: #cdd2dc;
    font-size: 0.72rem;
}

.sa-objectives__empty p {
    max-width: 560px;
    margin: 8px auto 0;
    font-size: 0.64rem;
    line-height: 1.5;
}

.sa-objectives__footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid rgba(195, 203, 222, 0.09);
}

.sa-objectives__footer p {
    margin: 0;
    color: #68748a;
    font-size: 0.59rem;
}

@media (max-width: 920px) {
    .sa-objectives__header {
        align-items: stretch;
        flex-direction: column;
    }

    .sa-objectives__actions {
        align-self: flex-start;
        flex-wrap: wrap;
    }

    .sa-objective-card__alignment {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sa-objectives__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sa-objectives__footer {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sa-objectives__metrics {
        grid-template-columns: 1fr;
    }

    .sa-objectives__metrics > div {
        padding: 13px 0;
        border-top: 1px solid rgba(195, 203, 222, 0.12);
        border-left: 0 !important;
    }

    .sa-objectives__actions {
        display: grid;
    }
}
