/* EM Recuérdame — diseño de tarjeta (versión compacta) */
.emr-card {
    --emr-pink: #e00a70;
    --emr-dark: #363636;
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    margin: 16px 0;
    padding: 14px 18px 14px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(54, 54, 54, .09), 0 1px 2px rgba(54, 54, 54, .08);
    overflow: hidden;
    color: var(--emr-dark);
    animation: emr-in .4s ease both;
}
.emr-card *, .emr-card *::before, .emr-card *::after { box-sizing: border-box; }
.emr-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
    background: linear-gradient(180deg, var(--emr-pink), #ff4fa3);
}

.emr-icon {
    flex: 0 0 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(224, 10, 112, .10);
    color: var(--emr-pink);
}
.emr-icon svg { width: 20px; height: 20px; transform-origin: 50% 0; animation: emr-ring 2.8s ease-in-out 1s infinite; }

.emr-body { flex: 1; min-width: 0; }
.emr-title { margin: 0 0 1px !important; font-size: 1.05rem; line-height: 1.25; font-weight: 700; color: var(--emr-dark); }
.emr-sub { margin: 0 0 10px !important; font-size: .85rem; line-height: 1.4; color: #6b6b6b; }

.emr-row { display: flex; gap: 8px; }
.emr-input {
    flex: 1; min-width: 0; height: 40px;
    padding: 0 16px !important;
    border: 2px solid #e6e6ea !important;
    border-radius: 999px !important;
    background: #f7f7f9 !important;
    font: inherit; font-size: .95rem; color: var(--emr-dark);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.emr-input::placeholder { color: #a3a3ab; }
.emr-input:focus {
    outline: none;
    background: #fff !important;
    border-color: var(--emr-pink) !important;
    box-shadow: 0 0 0 3px rgba(224, 10, 112, .15);
}

.emr-btn {
    position: relative;
    flex: 0 0 auto; height: 40px;
    padding: 0 20px !important;
    border: 0 !important; border-radius: 999px !important;
    background: var(--emr-pink) !important; color: #fff !important;
    font: inherit; font-size: .95rem; font-weight: 700; letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(224, 10, 112, .28);
    transition: transform .15s, box-shadow .2s, background .2s;
}
.emr-btn:hover { background: var(--emr-dark) !important; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(54, 54, 54, .26); }
.emr-btn:active { transform: translateY(0) scale(.98); }
.emr-btn:focus-visible { outline: 3px solid rgba(224, 10, 112, .4); outline-offset: 2px; }
.emr-btn[disabled] { cursor: progress; opacity: .9; transform: none; }

.emr-spin {
    display: none;
    position: absolute; left: 50%; top: 50%;
    width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border: 3px solid rgba(255, 255, 255, .4);
    border-top-color: #fff; border-radius: 50%;
    animation: emr-rot .7s linear infinite;
}
.emr-form.is-loading .emr-btn-text { visibility: hidden; }
.emr-form.is-loading .emr-spin { display: block; }

.emr-legal { margin: 6px 4px 0 !important; font-size: .72rem; line-height: 1.35; color: #9a9aa2; }
.emr-msg { margin: 6px 4px 0 !important; font-size: .85rem; font-weight: 600; }
.emr-msg:empty { display: none; }
.emr-msg.is-err { color: #c0152f; }
.emr-msg.is-ok { color: #1c8a4a; }
.emr-form.is-error .emr-row { animation: emr-shake .4s; }
.emr-form.is-error .emr-input { border-color: #c0152f !important; }

/* Éxito */
.emr-success[hidden] { display: none !important; }
.emr-card.is-done .emr-form,
.emr-card.is-done .emr-title,
.emr-card.is-done .emr-sub,
.emr-card.is-done .emr-icon { display: none; }
.emr-card.is-done .emr-success {
    display: grid; grid-template-columns: 38px 1fr; column-gap: 14px; align-items: center;
    animation: emr-in .4s ease both;
}
.emr-check { grid-row: 1 / span 3; width: 38px; height: 38px; }
.emr-success-title { margin: 0 !important; font-size: 1.05rem; font-weight: 700; color: var(--emr-dark); }
.emr-success-text { margin: 1px 0 0 !important; font-size: .85rem; color: #6b6b6b; }
.emr-reset {
    justify-self: start; margin: 4px 0 0 !important; padding: 0 !important;
    border: 0 !important; background: none !important; box-shadow: none !important;
    font: inherit; font-size: .8rem; color: var(--emr-pink) !important;
    text-decoration: underline; cursor: pointer;
}
.emr-reset:hover { color: var(--emr-dark) !important; }
.emr-check-c { fill: none; stroke: var(--emr-pink); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: emr-draw .6s .1s ease forwards; }
.emr-check-p { fill: none; stroke: var(--emr-pink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: emr-draw .4s .6s ease forwards; }

@keyframes emr-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes emr-rot { to { transform: rotate(360deg); } }
@keyframes emr-draw { to { stroke-dashoffset: 0; } }
@keyframes emr-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes emr-ring {
    0%, 12%, 100% { transform: rotate(0); }
    3% { transform: rotate(14deg); } 6% { transform: rotate(-12deg); } 9% { transform: rotate(8deg); }
}

@media (max-width: 520px) {
    .emr-card { flex-direction: column; align-items: flex-start; padding: 14px 14px 14px 20px; gap: 8px; }
    .emr-row { flex-direction: column; }
    .emr-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .emr-card, .emr-card.is-done .emr-success, .emr-icon svg, .emr-form.is-error .emr-row { animation: none; }
    .emr-check-c, .emr-check-p { animation: none; stroke-dashoffset: 0; }
}
