/* =========================================================
   MODULES PAGE — VERSION 2
   ========================================================= */

.modules-page {
    display: grid;
    gap: 24px;
    padding-bottom: 36px;
}


/* =========================================================
   LEARNER SUMMARY
   ========================================================= */

.modules-learner-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;

    padding: 22px 24px;

    background: linear-gradient(135deg, #fffdf5, #ffffff);
    border: 1px solid #eadfca;
    border-left: 6px solid #f2b525;
    border-radius: 18px;
    box-shadow: 0 7px 20px rgba(55, 65, 78, .08);
}

.modules-learner-icon {
    display: grid;
    place-items: center;

    width: 62px;
    height: 62px;

    background: #fff0b8;
    border-radius: 50%;

    font-size: 1.8rem;
}

.modules-learner-card h2 {
    margin: 0 0 5px;
    color: #273d57;
}

.modules-learner-card p {
    margin: 0;
    color: #667788;
    line-height: 1.6;
}


/* =========================================================
   OVERALL PROGRESS
   ========================================================= */

.modules-progress-card {
    padding: 22px 24px;

    background: #ffffff;
    border: 1px solid #dce5ef;
    border-left: 6px solid #7652c8;
    border-radius: 18px;
    box-shadow: 0 7px 20px rgba(55, 65, 78, .08);
}

.modules-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.modules-progress-header h2 {
    margin: 0;
    color: #303c55;
    font-size: 1.15rem;
}

.modules-progress-value {
    color: #6d47b8;
    font-weight: 900;
}

.modules-progress-track {
    width: 100%;
    height: 13px;

    overflow: hidden;

    background: #ece8f5;
    border-radius: 999px;
}

.modules-progress-fill {
    width: 0%;
    height: 100%;

    background: linear-gradient(90deg, #7652c8, #df65bb);
    border-radius: inherit;
    transition: width .35s ease;
}

.modules-progress-caption {
    margin: 10px 0 0;
    color: #74808d;
    font-size: .9rem;
}


/* =========================================================
   SECTION HEADING
   ========================================================= */

.modules-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.modules-section-heading h2 {
    margin: 0 0 5px;
    color: #263d56;
}

.modules-section-heading p {
    margin: 0;
    color: #6d7b88;
}


/* =========================================================
   MODULE CARD GRID
   ========================================================= */

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}


/* Individual card */

.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 420px;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 21px;
    box-shadow: 0 8px 23px rgba(41, 61, 82, .09);

    color: inherit;
    text-decoration: none;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.module-card.is-available:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 32px rgba(41, 61, 82, .14);
}


/* Colored top area */

.module-card-top {
    position: relative;
    min-height: 128px;
    padding: 22px;

    overflow: hidden;

    background: linear-gradient(135deg, #397fc2, #64b6df);
    color: #ffffff;
}

.module-card-top::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -55px;

    width: 145px;
    height: 145px;

    background: rgba(255, 255, 255, .11);
    border-radius: 50%;
}

.module-card-number {
    position: relative;
    z-index: 2;

    display: grid;
    place-items: center;

    width: 58px;
    height: 58px;

    background: rgba(255, 255, 255, .96);
    border-radius: 17px;

    color: #286ba4;
    font-size: 1.35rem;
    font-weight: 900;
}

.module-card-icon {
    position: absolute;
    z-index: 2;
    right: 22px;
    top: 22px;

    font-size: 2.4rem;
}


/* Card body */

.module-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.module-card-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.module-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;

    background: #e9f3ff;
    border-radius: 999px;

    color: #27699f;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.module-time {
    color: #7b8792;
    font-size: .78rem;
    font-weight: 700;
}

.module-card h2 {
    margin: 0 0 7px;

    color: #263b53;
    font-size: 1.25rem;
    line-height: 1.3;
}

.module-native-title {
    margin: 0 0 12px;

    color: #54708b;
    font-family: var(--font-ethiopic, Georgia, serif);
    font-size: 1.25rem;
    font-weight: 800;
}

.module-description {
    margin: 0 0 18px;

    color: #657484;
    font-size: .92rem;
    line-height: 1.65;
}


/* Bonus Fidel preview */

.module-bonus {
    margin-top: auto;
    padding: 14px;

    background: #f8f4ff;
    border: 1px solid #e2d6f2;
    border-radius: 14px;
}

.module-bonus-label {
    display: block;
    margin-bottom: 8px;

    color: #6c4995;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.module-fidel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.module-fidel-list span {
    display: grid;
    place-items: center;

    min-width: 34px;
    height: 34px;
    padding-inline: 7px;

    background: #ffffff;
    border: 1px solid #ded1ed;
    border-radius: 9px;

    color: #7045a1;
    font-family: var(--font-ethiopic, Georgia, serif);
    font-size: 1.05rem;
    font-weight: 850;
}


/* Card progress */

.module-progress {
    margin-top: 16px;
}

.module-progress-info {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;

    color: #71808e;
    font-size: .78rem;
    font-weight: 750;
}

.module-progress-track {
    height: 8px;

    overflow: hidden;

    background: #e9edf1;
    border-radius: 999px;
}

.module-progress-fill {
    height: 100%;

    background: #3b8dd0;
    border-radius: inherit;
}


/* Card action */

.module-card-action {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 44px;
    margin-top: 18px;
    padding: 10px 14px;

    background: #2e7fc2;
    border-radius: 12px;

    color: #ffffff;
    font-size: .88rem;
    font-weight: 850;
}


/* =========================================================
   INDIVIDUAL MODULE COLORS
   ========================================================= */

.module-theme-1 .module-card-top {
    background: linear-gradient(135deg, #317ec2, #65b9df);
}

.module-theme-2 .module-card-top {
    background: linear-gradient(135deg, #42a45b, #82cc72);
}

.module-theme-3 .module-card-top {
    background: linear-gradient(135deg, #d45c9e, #ee88bf);
}

.module-theme-4 .module-card-top {
    background: linear-gradient(135deg, #dc7829, #f3ae49);
}

.module-theme-5 .module-card-top {
    background: linear-gradient(135deg, #7251bd, #a880dc);
}

.module-theme-6 .module-card-top {
    background: linear-gradient(135deg, #187f87, #4db9b3);
}

.module-theme-2 .module-card-number {
    color: #32844a;
}

.module-theme-3 .module-card-number {
    color: #b44282;
}

.module-theme-4 .module-card-number {
    color: #b75c17;
}

.module-theme-5 .module-card-number {
    color: #6543aa;
}

.module-theme-6 .module-card-number {
    color: #14737a;
}


/* =========================================================
   MODULE STATES
   ========================================================= */

.module-card.is-completed {
    border-color: #b9dfc0;
}

.module-card.is-completed .module-status-badge {
    background: #e4f7e7;
    color: #287a3d;
}

.module-card.is-completed .module-card-action {
    background: #31884a;
}

.module-card.is-current {
    border: 2px solid #3b8dd0;
}

.module-card.is-current .module-status-badge {
    background: #e6f3ff;
    color: #246da5;
}

.module-card.is-locked {
    cursor: not-allowed;
    opacity: .68;
}

.module-card.is-locked .module-card-top {
    filter: grayscale(.3);
}

.module-card.is-locked .module-status-badge {
    background: #eceff2;
    color: #6d7882;
}

.module-card.is-locked .module-card-action {
    background: #8b949c;
}

.module-card.is-locked:hover {
    transform: none;
    box-shadow: 0 8px 23px rgba(41, 61, 82, .09);
}


/* =========================================================
   PAGE ACTIONS
   ========================================================= */

.modules-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    padding: 22px;

    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(41, 61, 82, .07);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1050px) {

    .modules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .modules-learner-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .modules-learner-icon {
        margin-inline: auto;
    }

    .modules-section-heading,
    .modules-progress-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: auto;
    }

    .modules-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modules-actions a,
    .modules-actions button {
        width: 100%;
    }
}