/* Lala Masala - brand primitives that are not expressible as Tailwind utilities.
   Kept deliberately small: layout and spacing belong in the templates. */

:root {
    --lm-masala: #a6231d;
    --lm-turmeric: #e9a319;
    --lm-cream: #fff8ee;
    --lm-charcoal: #2a211c;
}

/* The hidden attribute must beat display utilities such as .flex, which
   otherwise leave dialogs and drawers visible on load. */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    text-rendering: optimizeLegibility;
}

/* Consistent focus ring for keyboard users across buttons, links and inputs. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--lm-masala);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reusable component classes ------------------------------------------------ */

.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    line-height: 1;
    padding: 0.8125rem 1.5rem;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lm-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.lm-btn:disabled,
.lm-btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
}

.lm-btn-primary {
    background-color: var(--lm-masala);
    color: #fff;
}

.lm-btn-primary:hover:not(:disabled) {
    background-color: #8e1e19;
}

.lm-btn-secondary {
    background-color: #fff;
    color: var(--lm-charcoal);
    box-shadow: inset 0 0 0 1px #e7d9c6;
}

.lm-btn-secondary:hover:not(:disabled) {
    background-color: var(--lm-cream);
}

.lm-btn-ghost {
    color: var(--lm-masala);
}

.lm-btn-ghost:hover:not(:disabled) {
    background-color: #fbedec;
}

.lm-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #e7d9c6;
    background-color: #fff;
    padding: 0.6875rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--lm-charcoal);
}

.lm-input::placeholder {
    color: #a8998c;
}

.lm-input:focus {
    border-color: var(--lm-masala);
    box-shadow: 0 0 0 3px rgba(166, 35, 29, 0.12);
    outline: none;
}

.lm-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a3d35;
}

.lm-error {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #b3261e;
}

/* Card ---------------------------------------------------------------------- */

.lm-card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(42, 33, 28, 0.06), 0 8px 24px -12px rgba(42, 33, 28, 0.18);
}

/* Toasts -------------------------------------------------------------------- */

.lm-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    max-width: 32rem;
    border-radius: 0.875rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
    background-color: var(--lm-charcoal);
    box-shadow: 0 12px 32px -12px rgba(42, 33, 28, 0.45);
    animation: lm-toast-in 0.18s ease-out;
}

.lm-toast[data-variant='success'] { background-color: #2f6b34; }
.lm-toast[data-variant='error'] { background-color: #9f1f19; }
.lm-toast[data-variant='info'] { background-color: #2a211c; }

@keyframes lm-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading state ---------------------------------------------------- */

.lm-skeleton {
    background: linear-gradient(90deg, #f1e6d6 25%, #f8f0e4 37%, #f1e6d6 63%);
    background-size: 400% 100%;
    animation: lm-shimmer 1.3s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes lm-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .lm-skeleton,
    .lm-toast {
        animation: none;
    }
}
