/* Nòduls · Pas 3 — Estructura anual */

.annual-builder {
    margin-top: 34px;
}

.annual-builder__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(195, 203, 222, 0.12);
}

.annual-builder__eyebrow {
    color: #aaa5ff;
    font-size: 0.62rem;
    font-weight: 760;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.annual-builder__header h3 {
    margin: 11px 0 0;
    color: #f4f1eb;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: clamp(1.9rem, 3.2vw, 3.2rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.annual-builder__header p {
    max-width: 660px;
    margin: 13px 0 0;
    color: #9ca6b9;
    font-size: 0.8rem;
    line-height: 1.65;
}

.annual-builder__starter,
.annual-term__add,
.annual-item__actions button,
.annual-item__continue {
    font: inherit;
    cursor: pointer;
}

.annual-builder__starter {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(168, 161, 248, 0.28);
    border-radius: 2px;
    color: #eeeefe;
    background: rgba(126, 121, 225, 0.11);
    font-size: 0.72rem;
    font-weight: 680;
}

.annual-builder__starter:hover {
    background: rgba(126, 121, 225, 0.19);
}

.annual-builder__starter[hidden] {
    display: none;
}

.annual-builder__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
    border-top: 1px solid rgba(195, 203, 222, 0.12);
    border-bottom: 1px solid rgba(195, 203, 222, 0.12);
}

.annual-builder__summary > div {
    padding: 17px 20px 17px 0;
}

.annual-builder__summary > div + div {
    padding-left: 20px;
    border-left: 1px solid rgba(195, 203, 222, 0.12);
}

.annual-builder__summary span {
    display: block;
    color: #748097;
    font-size: 0.61rem;
    font-weight: 720;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.annual-builder__summary strong {
    display: block;
    margin-top: 8px;
    color: #e7e9f0;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: 1.45rem;
    font-weight: 500;
}

.annual-builder__terms {
    display: grid;
    gap: 22px;
    margin-top: 28px;
}

.annual-term {
    border: 1px solid rgba(195, 203, 222, 0.13);
    border-radius: 2px;
    background: rgba(7, 15, 28, 0.34);
}

.annual-term__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 64px;
    padding: 12px 16px 12px 20px;
    border-bottom: 1px solid rgba(195, 203, 222, 0.11);
}

.annual-term__header > div {
    display: grid;
    gap: 5px;
}

.annual-term__header [data-term-number] {
    color: #e8e9ef;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: 1.1rem;
}

.annual-term__header [data-term-count] {
    color: #748097;
    font-size: 0.63rem;
    font-weight: 650;
}

.annual-term__add {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid rgba(184, 193, 214, 0.14);
    border-radius: 2px;
    color: #d9dce5;
    background: transparent;
    font-size: 0.69rem;
    font-weight: 680;
}

.annual-term__add:hover {
    border-color: rgba(164, 157, 246, 0.42);
    background: rgba(126, 121, 225, 0.08);
}

.annual-term__list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.annual-term__list:empty {
    display: none;
}

.annual-term__empty {
    margin: 0;
    padding: 26px 20px;
    color: #68748a;
    font-size: 0.72rem;
    text-align: center;
}

.annual-term__empty[hidden] {
    display: none;
}

.annual-item {
    border: 1px solid rgba(195, 203, 222, 0.12);
    border-radius: 2px;
    background:
        linear-gradient(
            135deg,
            rgba(18, 31, 51, 0.72),
            rgba(9, 18, 32, 0.72)
        );
}

.annual-item__header {
    min-height: 55px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 11px 12px 11px 16px;
    border-bottom: 1px solid rgba(195, 203, 222, 0.1);
}

.annual-item__header > div:first-child {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 11px;
}

.annual-item__header [data-item-code] {
    flex: 0 0 auto;
    color: #aaa5ff;
    font-size: 0.65rem;
    font-weight: 760;
    letter-spacing: 0.1em;
}

.annual-item__header [data-item-heading] {
    min-width: 0;
    overflow: hidden;
    color: #e8eaf0;
    font-family:
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;
    font-size: 1.06rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.annual-item__actions {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.annual-item__actions button {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 2px;
    color: #8994a8;
    background: transparent;
}

.annual-item__actions button:hover:not(:disabled) {
    border-color: rgba(190, 199, 220, 0.14);
    color: #f1f2f6;
    background: rgba(255, 255, 255, 0.025);
}

.annual-item__actions button:disabled {
    opacity: 0.22;
    cursor: not-allowed;
}

.annual-item__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 18px 16px;
}

.annual-item__field {
    display: grid;
    gap: 8px;
}

.annual-item__field--wide {
    grid-column: 1 / -1;
}

.annual-item__field > span {
    color: #cdd2dd;
    font-size: 0.66rem;
    font-weight: 680;
}

.annual-item__field input,
.annual-item__field textarea,
.annual-item__field select {
    width: 100%;
    border: 1px solid rgba(188, 198, 220, 0.13);
    border-radius: 2px;
    outline: none;
    color: #f2f4f8;
    background: rgba(5, 12, 23, 0.46);
    font: inherit;
}

.annual-item__field input,
.annual-item__field select {
    min-height: 44px;
    padding: 0 12px;
}

.annual-item__field textarea {
    min-height: 72px;
    padding: 11px 12px;
    resize: vertical;
}

.annual-item__field input:focus,
.annual-item__field textarea:focus,
.annual-item__field select: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);
}

.annual-item__footer {
    min-height: 52px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 9px 12px 9px 16px;
    border-top: 1px solid rgba(195, 203, 222, 0.1);
}

.annual-item__footer > span {
    color: #748097;
    font-size: 0.65rem;
}

.annual-item__footer > span.is-ready {
    color: #9ad7be;
}

.annual-item__continue {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid rgba(164, 157, 246, 0.18);
    border-radius: 2px;
    color: #8d91a5;
    background: rgba(126, 121, 225, 0.05);
    font-size: 0.67rem;
}

.annual-item__continue:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.annual-builder__status {
    margin: 18px 0 0;
    color: #748097;
    font-size: 0.66rem;
}

@media (max-width: 760px) {
    .annual-builder__header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .annual-builder__starter {
        justify-self: start;
    }

    .annual-builder__summary {
        grid-template-columns: 1fr;
    }

    .annual-builder__summary > div {
        padding: 14px 0;
    }

    .annual-builder__summary > div + div {
        padding-left: 0;
        border-top: 1px solid rgba(195, 203, 222, 0.12);
        border-left: 0;
    }

    .annual-item__fields {
        grid-template-columns: 1fr;
    }

    .annual-item__field--wide {
        grid-column: auto;
    }
}
