/* ==========================================================
   T - UPSC MAINS AI — front-end styles (lavender theme)
   Solid colours only: no gradients, glass, blur or transparency.
   Visual design only; markup and behaviour are unchanged.
   ========================================================== */

.upsc-ma-wrap {
    --ma-lavender: #E6E0F8;
    --ma-blue: #1D4ED8;
    --ma-blue-dark: #1E40AF;
    --ma-shadow-card: 0 2px 6px rgba(60, 40, 120, .16);

    box-sizing: border-box;
    max-width: 900px;
    margin: 30px auto;
    padding: 28px;
    background: var(--ma-lavender);
    border: 0;
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(60, 40, 120, .18), 0 3px 8px rgba(60, 40, 120, .12);
    color: #000;
    font-family: inherit;
    line-height: 1.5;
}

.upsc-ma-wrap,
.upsc-ma-wrap * {
    box-sizing: border-box;
}

/* All text black (the submit button is styled separately below) */
.upsc-ma-wrap *:not(button) {
    color: #000 !important;
}

/* The JS shows/hides the result with the [hidden] attribute — keep it honoured */
.upsc-ma-wrap [hidden] {
    display: none !important;
}

/* ---------- Question card ---------- */

.upsc-ma-wrap .upsc-ma-question {
    margin: 0 0 22px;
    padding: 20px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--ma-shadow-card);
    font-size: 18px;
    line-height: 1.65;
}

.upsc-ma-wrap .upsc-ma-question h2 {
    margin: 0 0 14px;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
}

.upsc-ma-wrap .upsc-ma-question p:last-child {
    margin-bottom: 0;
}

/* ---------- Answer ---------- */

.upsc-ma-wrap .upsc-ma-label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.upsc-ma-wrap .upsc-ma-answer {
    display: block;
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 14px;
    box-shadow: var(--ma-shadow-card);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
}

.upsc-ma-wrap .upsc-ma-answer:focus {
    outline: none;
    border-color: var(--ma-blue);
}

.upsc-ma-wrap .upsc-ma-answer::placeholder {
    color: #000;
    opacity: 1;
    font-style: italic;
}

.upsc-ma-wrap .upsc-ma-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 2px 16px;
    font-size: 14px;
    font-weight: 600;
}

/* ---------- Submit button ---------- */

.upsc-ma-wrap .upsc-ma-submit {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 12px 26px;
    background: var(--ma-blue);
    border: 0;
    border-radius: 10px;
    color: #fff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .4px;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60, 40, 120, .24);
    transition: background-color .12s ease, box-shadow .12s ease;
}

.upsc-ma-wrap .upsc-ma-submit:hover,
.upsc-ma-wrap .upsc-ma-submit:active {
    background: var(--ma-blue-dark);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(60, 40, 120, .3);
}

.upsc-ma-wrap .upsc-ma-submit:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* Busy state: no fading — a darker blue and a wait cursor */
.upsc-ma-wrap .upsc-ma-submit:disabled {
    background: #1E3A8A;
    color: #fff !important;
    cursor: wait;
    box-shadow: none;
}

/* ---------- Status message ---------- */

.upsc-ma-wrap .upsc-ma-status {
    font-weight: 600;
}

.upsc-ma-wrap .upsc-ma-status:not(:empty) {
    display: inline-block;
    max-width: 100%;
    margin-top: 14px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--ma-shadow-card);
}

/* ---------- Result cards ---------- */

.upsc-ma-wrap .upsc-ma-result {
    margin-top: 22px;
    padding: 0;
    border: 0;
}

.upsc-ma-wrap .upsc-ma-score {
    margin: 0 0 14px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--ma-shadow-card);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.upsc-ma-wrap .upsc-ma-section {
    margin: 14px 0;
    padding: 18px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--ma-shadow-card);
}

.upsc-ma-wrap .upsc-ma-section h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
}

.upsc-ma-wrap .upsc-ma-section ul {
    margin: 8px 0 0 20px;
}

.upsc-ma-wrap .upsc-ma-params {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* Cards inside a white card: lavender outline keeps them distinct */
.upsc-ma-wrap .upsc-ma-param {
    padding: 12px;
    background: #fff;
    border: 2px solid var(--ma-lavender);
    border-radius: 12px;
    box-shadow: var(--ma-shadow-card);
}

.upsc-ma-wrap .upsc-ma-param strong {
    display: block;
    margin-bottom: 4px;
}

/* ---------- Small screens ---------- */

@media (max-width: 650px) {
    .upsc-ma-wrap {
        padding: 16px;
        border-radius: 18px;
    }

    .upsc-ma-wrap .upsc-ma-question {
        padding: 16px;
    }

    .upsc-ma-wrap .upsc-ma-question h2 {
        font-size: 21px;
    }

    .upsc-ma-wrap .upsc-ma-params {
        grid-template-columns: 1fr;
    }

    .upsc-ma-wrap .upsc-ma-submit {
        width: 100%;
    }

    .upsc-ma-wrap .upsc-ma-score,
    .upsc-ma-wrap .upsc-ma-section {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .upsc-ma-wrap .upsc-ma-submit {
        transition: none;
    }
}
