/* ==========================================================================
   views/metas.css — Estilos exclusivos de Metas de ahorro (metas.html)
   Prefijo de clases: mg-
   ========================================================================== */

/* Tarjeta destacada: total ahorrado */
.mg-total {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: 22px;
    color: var(--white);
    background: linear-gradient(140deg, #34D399 0%, #059669 55%, #064E3B 100%);
    box-shadow: 0 24px 48px -20px rgba(6, 78, 59, .55);
}
.mg-total::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -60px;
    bottom: -90px;
    border-radius: 50%;
    border: 28px solid rgba(255, 255, 255, .08);
    pointer-events: none;
}
.mg-total-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.mg-total-label { font-size: 12px; color: rgba(255, 255, 255, .78); }
.mg-total-amount { font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--white); margin: 2px 0; }
.mg-total-sub { font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.mg-total .ui-pill { white-space: nowrap; }

.mg-stack {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 3px;
    height: 10px;
    margin-top: 16px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
}
.mg-stack i {
    display: block;
    height: 100%;
    border-radius: 999px;
    transform-origin: left;
    animation: ui-bar-in 1.1s var(--app-ease) both;
}
.mg-s-green  { background: #BBF7D0; }
.mg-s-indigo { background: #C7D2FE; }
.mg-s-orange { background: #FED7AA; }

.mg-legend {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
}
.mg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mg-legend i { width: 8px; height: 8px; border-radius: 50%; }

/* Tarjeta de meta con anillo de progreso */
.mg-goal {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    box-shadow: var(--app-shadow);
}
.mg-ring {
    position: relative;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 50%;
    background: none !important;
}
.mg-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mg-ring circle { fill: none; stroke-width: 8; }
.mg-ring-bg { stroke: var(--tone-bg); }
.mg-ring-fg {
    stroke: var(--tone);
    stroke-linecap: round;
    stroke-dasharray: var(--p) 100;
    animation: mg-ring-in 1.2s var(--app-ease) both;
}
.mg-ring strong {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-base);
}
@keyframes mg-ring-in {
    from { stroke-dasharray: 0 100; }
}

.mg-goal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mg-goal-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mg-goal-title p {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mg-goal-amt { font-size: 13px; color: var(--greyscale-500); }
.mg-goal-amt b { color: var(--primary-base); font-weight: 700; }
.mg-goal-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--greyscale-500); }
.mg-goal-hint {
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--greyscale-50);
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--greyscale-600);
}
.mg-goal-hint b { color: var(--primary-base); }

/* Calculadora */
.mg-calc .mod-form-row fieldset { margin-bottom: 0; }
.mg-calc-result {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: var(--c-green-bg);
}
.mg-calc-result .mod-item-ico { background: var(--white); }
.mg-calc-result p { font-size: 24px; font-weight: 700; color: var(--primary-base); line-height: 1.2; }
.mg-calc-result p small { font-size: 13px; font-weight: 500; color: var(--greyscale-500); }
.mg-calc-result span { display: block; }

/* Metas completadas */
.mg-done { position: relative; }
.mg-done::after {
    content: "Cumplida";
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--c-green);
    background: var(--c-green-bg);
}
