/*
 * LawPlainly loaders: placeholder cards while lawyer results load, and a small
 * spinner inside buttons while a form sends. Driven by js/loaders.js.
 * No full-page loader on purpose: the page stays readable while it works.
 */

/* ---- Button spinner ------------------------------------------------------ */
.lp-busy { position: relative; cursor: progress !important; pointer-events: none; }
.lp-busy > i, .lp-busy > svg:not(.lp-spin) { display: none !important; }
.lp-busy:disabled, .lp-busy[aria-disabled="true"] { opacity: 1 !important; }
.lp-spin {
    flex: none; width: 1.15em; height: 1.15em; margin-right: .1em; vertical-align: -.2em;
    animation: lp-turn .8s cubic-bezier(.55, .15, .45, .85) infinite;
}
.lp-spin__track { stroke: currentColor; opacity: .22; }
.lp-spin__arc { stroke: var(--brass-light, #E9D7A8); }
.lp-spin__dot { fill: var(--brass-light, #E9D7A8); }
/* On light buttons the arc takes the action green instead of brass. */
.lp-busy--light .lp-spin__arc { stroke: var(--action, #1E6B52); }
.lp-busy--light .lp-spin__dot { fill: var(--brass, #C2913A); }
/* Buttons that aren't flex have no gap between icon and text. */
.lp-busy--inline .lp-spin { margin-right: .5em; }
@keyframes lp-turn { to { transform: rotate(360deg); } }

/* ---- Placeholder lawyer cards ------------------------------------------- */
.lp-skel {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) 200px; gap: 20px;
    padding: 22px; background: #fff; border: 1px solid var(--rule, #DCE1DD); border-radius: 12px;
}
.lp-skel + .lp-skel { margin-top: 0; }
.lp-skel__col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lp-skel__b {
    display: block; height: 12px; border-radius: 6px; background: #ECEFEC;
    position: relative; overflow: hidden;
}
.lp-skel__b::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7) 45%, rgba(233, 215, 168, .1) 55%, transparent);
    animation: lp-shine 1.4s ease-in-out infinite;
}
.lp-skel__photo { width: 72px; height: 72px; border-radius: 16px; }
.lp-skel__name { height: 20px; width: 58%; border-radius: 7px; }
.lp-skel__meta { width: 38%; }
.lp-skel__stars { width: 30%; height: 14px; background: #EDEDE8; }
.lp-skel__line { width: 92%; }
.lp-skel__line--short { width: 64%; }
.lp-skel__pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.lp-skel__pill { width: 92px; height: 24px; border-radius: 999px; }
.lp-skel__pill:nth-child(2) { width: 118px; }
.lp-skel__pill:nth-child(3) { width: 76px; }
.lp-skel__btn { height: 44px; width: 100%; border-radius: 8px; }
.lp-skel__btn--main { background: #E4E9E6; }
.lp-skel__title { height: 22px; width: 180px; border-radius: 7px; margin: 0 0 16px; }
/* Each card starts its shine a little later, so the list reads top to bottom. */
.lp-skel:nth-child(2) .lp-skel__b::after { animation-delay: .12s; }
.lp-skel:nth-child(3) .lp-skel__b::after { animation-delay: .24s; }
.lp-skel:nth-child(4) .lp-skel__b::after { animation-delay: .36s; }
.lp-skel:nth-child(5) .lp-skel__b::after { animation-delay: .48s; }
.lp-skel:nth-child(6) .lp-skel__b::after { animation-delay: .6s; }
@keyframes lp-shine { 60%, 100% { transform: translateX(100%); } }

@media (max-width: 1100px) {
    .lp-skel { grid-template-columns: 64px minmax(0, 1fr); }
    .lp-skel__photo { width: 64px; height: 64px; }
    .lp-skel__side { grid-column: 2; flex-direction: row; }
    .lp-skel__btn { width: 130px; }
}
@media (max-width: 640px) {
    .lp-skel { grid-template-columns: 56px minmax(0, 1fr); gap: 10px 14px; padding: 16px; border-radius: 18px; }
    .lp-skel__photo { width: 56px; height: 56px; }
    .lp-skel__side { grid-column: 1 / -1; }
    .lp-skel__btn { flex: 1; width: auto; }
}

/* ---- Results filling in -------------------------------------------------- */
[aria-busy="true"] > .results__list:not(.lp-skel-list) { opacity: .45; transition: opacity .15s; }
.lp-in { animation: lp-rise .38s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.lp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Reduced motion: no turning, sliding or shining ---------------------- */
@media (prefers-reduced-motion: reduce) {
    .lp-spin { animation: lp-fade 1.6s ease-in-out infinite; }
    .lp-skel__b::after { display: none; }
    .lp-in { animation: none; }
    @keyframes lp-fade { 50% { opacity: .45; } }
}
