/**
 * MahyaPanel — front-end styles for the test-result card.
 *
 * Every visual value comes from CSS custom properties (--mh-*) emitted per card instance by
 * mahyapanel_build_display_css(), so the static rules here only define the layout.
 */

.mahya-test-result {
    --mh-card-max-w: 880px;
    --mh-card-bg: #ffffff;
    --mh-card-pad: 28px;
    --mh-card-radius: 14px;
    --mh-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    --mh-accent-color: #4f46e5;
    --mh-accent-h: 6px;
    --mh-title-size: 26px;
    --mh-title-weight: 700;
    --mh-title-color: #111827;
    --mh-title-align: center;
    --mh-image-w: 100%;
    --mh-image-radius: 12px;
    --mh-image-align: center;
    --mh-meta-color: #6b7280;
    --mh-meta-size: 13px;
    --mh-sec-title-size: 19px;
    --mh-sec-title-color: #111827;
    --mh-sec-border: 1px solid #eceff3;
    --mh-sec-gap: 26px;
    --mh-body-size: 16px;
    --mh-body-lh: 1.9;
    --mh-body-color: #374151;
    --mh-font: inherit;

    direction: rtl;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: var(--mh-card-max-w);
    margin: 0 auto 28px;
    padding: var(--mh-card-pad);
    background: var(--mh-card-bg);
    border-radius: var(--mh-card-radius);
    box-shadow: var(--mh-shadow);
    font-family: var(--mh-font);
    overflow: hidden;
}

.mahya-test-result *,
.mahya-test-result *::before,
.mahya-test-result *::after {
    box-sizing: border-box;
}

/* Accent bar */
.mahya-tr-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: var(--mh-accent-h);
    background: var(--mh-accent-color);
}

/* Fade-in animation (class added by JS so content is never hidden without JS) */
.mahya-test-result.mahya-tr-fade {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.mahya-test-result.mahya-tr-fade.mahya-tr-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .mahya-test-result.mahya-tr-fade {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Title */
.mahya-tr-title {
    margin: 6px 0 18px;
    text-align: var(--mh-title-align);
    font-size: var(--mh-title-size);
    font-weight: var(--mh-title-weight);
    line-height: 1.5;
    color: var(--mh-title-color);
}

/* Image */
.mahya-tr-image {
    text-align: var(--mh-image-align);
    margin-bottom: 22px;
}

.mahya-tr-image img {
    display: inline-block;
    width: auto;
    max-width: var(--mh-image-w);
    height: auto;
    border-radius: var(--mh-image-radius);
}

/* Meta */
.mahya-tr-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin-bottom: 22px;
}

.mahya-tr-meta-item {
    font-size: var(--mh-meta-size);
    color: var(--mh-meta-color);
}

/* Chart */
.mahya-tr-chart {
    margin: 6px 0 24px;
}

.mahya-chart-box {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.mahya-chart-box canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Sections */
.mahya-tr-section + .mahya-tr-section {
    margin-top: var(--mh-sec-gap);
}

.mahya-tr-section-title {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: var(--mh-sec-border);
    font-size: var(--mh-sec-title-size);
    line-height: 1.5;
    color: var(--mh-sec-title-color);
}

.mahya-tr-content {
    font-size: var(--mh-body-size);
    line-height: var(--mh-body-lh);
    color: var(--mh-body-color);
    word-wrap: break-word;
}

.mahya-tr-content p {
    margin: 0 0 0.85em;
}

.mahya-tr-content p:last-child {
    margin-bottom: 0;
}

.mahya-tr-content img {
    max-width: 100%;
    height: auto;
}

/* Action buttons */
.mahya-tr-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.mahya-tr-btn {
    cursor: pointer;
    border: 0;
    font-family: inherit;
    line-height: 1.4;
}

.mahya-tr-btn:hover,
.mahya-tr-btn:focus {
    opacity: 0.9;
    color: inherit;
}

/* Analysis block */
.mahya-tr-analysis {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid #eceff3;
}

.mahya-cta-box {
    background: #f8fafc;
    border: 1px solid #e5e9f0;
    border-radius: 12px;
    padding: 22px;
}

.mahya-cta-title {
    margin: 0 0 10px;
    font-size: 1.15em;
    color: #111827;
}

.mahya-cta-text {
    margin: 0 0 16px;
    line-height: 1.9;
    color: #4b5563;
}

.mahya-form-title {
    margin: 0 0 12px;
    font-weight: 600;
    color: #374151;
}

.mahya-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.mahya-field {
    display: block;
    margin-bottom: 14px;
}

.mahya-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92em;
    color: #374151;
}

.mahya-req {
    color: #dc2626;
    font-style: normal;
}

.mahya-field input[type="text"],
.mahya-field input[type="tel"],
.mahya-field input[type="email"],
.mahya-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5dbe5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.98em;
    background: #fff;
    color: #111827;
}

.mahya-field input:focus,
.mahya-field textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.mahya-field-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.92em;
    color: #4b5563;
}

.mahya-field-check input {
    margin-top: 4px;
}

.mahya-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.mahya-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.mahya-cta-btn {
    cursor: pointer;
    border: 0;
    font-family: inherit;
    padding: 12px 22px;
    color: #ffffff;
    background: #0ea5e9;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.5;
    transition: opacity 0.2s ease;
}

.mahya-cta-btn:hover {
    opacity: 0.92;
}

.mahya-cta-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.mahya-price-note {
    font-size: 0.95em;
    color: #374151;
}

.mahya-form-msg {
    margin: 12px 0 0;
    color: #b91c1c;
    font-size: 0.93em;
    min-height: 1em;
}

/* Payment flash / pending / report boxes */
.mahya-pay-flash,
.mahya-pending-box,
.mahya-report-box {
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    line-height: 1.9;
}

.mahya-pay-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.mahya-pay-failed {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.mahya-pay-reason {
    display: block;
    margin-top: 6px;
    font-size: 0.9em;
    opacity: 0.9;
}

.mahya-pending-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.mahya-pending-title,
.mahya-report-title {
    margin: 0 0 8px;
    font-size: 1.1em;
}

.mahya-pending-meta,
.mahya-report-meta {
    margin: 8px 0 0;
    font-size: 0.9em;
    opacity: 0.85;
}

.mahya-report-box {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    color: #1e3a8a;
}

.mahya-report-content {
    color: #1f2937;
    margin-top: 8px;
}

/* Print: keep the card (and a published report), drop the interactive parts */
@media print {
    .mahya-tr-actions,
    .mahya-cta-box,
    .mahya-pay-flash,
    .mahya-pending-box {
        display: none !important;
    }

    .mahya-test-result {
        box-shadow: none;
        border: 1px solid #ddd;
        max-width: 100%;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .mahya-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mahya-cta-btn {
        width: 100%;
    }
}
