/* ============================================================
   curso-app.css — El Camino Interior
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
    color: #1e1a16;
    background: #FAF7F2;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   SHARED — header usado en unidad.php
   ============================================================ */

.course-header {
    min-height: 80px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid rgba(185,151,111,0.18);
    box-shadow: 0 6px 24px rgba(0,0,0,0.04);
}

.course-logo img { height: 52px; width: auto; display: block; }

.course-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: #666;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.course-nav a:hover { color: #8c6d49; }

/* ============================================================
   SHARED — shell y hero usados en unidad.php
   ============================================================ */

.course-shell {
    width: min(1100px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 4rem 0 5rem;
}

.course-hero { margin-bottom: 2.5rem; }

.course-kicker {
    color: #B9976F;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.course-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.course-hero p { color: #666; font-size: 1rem; line-height: 1.75; }

/* ============================================================
   UNIT READER — unidad.php
   ============================================================ */

.unit-reader {
    background: #fff;
    border: 1px solid rgba(185,151,111,0.18);
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.unit-reader iframe {
    width: 100%;
    min-height: 74vh;
    border: 0;
    border-radius: 8px;
    background: #fff;
    display: block;
}

.unit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.unit-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 1.4rem;
    border-radius: 999px;
    background: #B9976F;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.unit-action:hover { background: #9e7f5b; }

.secondary-link {
    color: #8c6d49;
    font-size: 0.82rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(140,109,73,0.3);
    padding-bottom: 1px;
}

/* ============================================================
   DASHBOARD — mi-espacio-personal.php
   ============================================================ */

.page-dashboard {
    background: #F4F0E8;
    min-height: 100vh;
}

/* -- Barra superior -- */
.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: #1e1a16;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dash-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #e8ddd0;
    letter-spacing: 0.02em;
}

.dash-exit {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #B9976F;
    border-bottom: 1px solid rgba(185,151,111,0.35);
    padding-bottom: 1px;
    transition: color 0.15s;
}
.dash-exit:hover { color: #d4b58a; }

/* -- Banner felicitaciones -- */
.dash-congrats {
    background: #2d4a2d;
    color: #e8f5e8;
    border-bottom: 1px solid rgba(100,180,100,0.2);
}

.dc-congrats-inner {
    width: min(1000px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.dc-congrats-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.dc-congrats-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a8e6a8;
}

.dc-dismiss {
    background: transparent;
    border: none;
    color: rgba(232,245,232,0.5);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.2rem;
    flex-shrink: 0;
    font-family: inherit;
}
.dc-dismiss:hover { color: #e8f5e8; }

/* -- Shell -- */
.dash-shell {
    width: min(1020px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 4rem 0 7rem;
}

/* -- Encabezado -- */
.dash-header { margin-bottom: 3rem; }

.dash-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #B9976F;
    margin-bottom: 0.7rem;
}

.dash-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    line-height: 1.08;
    color: #1e1a16;
    margin-bottom: 0.6rem;
}

.dash-desc {
    font-size: 0.87rem;
    color: #7a6e62;
    line-height: 1.75;
    max-width: 520px;
}

/* -- Grilla de tarjetas -- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

/* -- Tarjeta -- */
.dash-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s, box-shadow 0.18s;
}

.dash-card:not(.is-locked):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(0,0,0,0.12);
}

.dash-card.is-locked {
    opacity: 0.58;
}

/* -- Portada -- */
.dc-cover {
    height: 130px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 0.9rem 1rem;
    overflow: hidden;
}

.dc-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.50) 100%);
}

.dc-badge {
    position: relative;
    z-index: 2;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0,0,0,0.35);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.18);
    white-space: nowrap;
}

.dc-badge.badge-done  { background: rgba(45,120,45,0.75); }
.dc-badge.badge-next  { background: rgba(185,151,111,0.85); }
.dc-badge.badge-ok    { background: rgba(80,130,180,0.75); }
.dc-badge.badge-locked{ background: rgba(0,0,0,0.40); }

.dc-num {
    position: absolute;
    right: 0.6rem;
    top: -0.4rem;
    font-family: 'Playfair Display', serif;
    font-size: 5.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.12);
    line-height: 1;
    user-select: none;
    z-index: 1;
}

/* -- Cuerpo -- */
.dc-body {
    padding: 1.3rem 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.35rem;
}

.dc-kicker {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #B9976F;
}

.dc-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.18rem;
    line-height: 1.22;
    color: #1e1a16;
}

.dc-sub {
    font-size: 0.8rem;
    color: #8a7e72;
    line-height: 1.55;
    margin-bottom: 0.3rem;
}

.dc-progress {
    height: 3px;
    background: #e8e2d8;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.4rem 0 0.8rem;
}

.dc-progress span {
    display: block;
    height: 100%;
    background: #B9976F;
    border-radius: 999px;
}

.dc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    margin-top: auto;
    padding: 0.55rem 1.2rem;
    border: 1.5px solid #B9976F;
    color: #7a5e3a;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.dc-btn:hover { background: #B9976F; color: #fff; }

.dc-locked {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #b0a89e;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-topbar { padding: 0.9rem 1.4rem; }
    .dash-shell  { padding: 2.5rem 0 5rem; }
    .course-header { flex-direction: column; align-items: flex-start; padding: 1rem 1.2rem; }
    .course-nav { width: 100%; justify-content: space-between; font-size: 0.7rem; }
}
