/* Builder wrapper resets */
.wpcode-shortcode-wrapper,
.wpcode-block,
.wp-block-shortcode {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide empty paragraphs injected around shortcodes */
.ls-ielts-writing-wrap + p:empty,
.lsqz-ielts-writing-container + p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.lsqz-pte-container {
    max-width: 800px;
    margin: var(--quiz-head-gap, 24px) auto var(--quiz-bottom-gap, 32px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
}

.lsqz-pte-container .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.lsqz-pte-header h2 {
    font-size: 24px;
    margin: 0 0 8px;
    color: #0f172a;
}

.lsqz-pte-instruction {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 12px 16px;
    border-left: 4px solid #16a34a;
    border-radius: 4px;
}

.lsqz-pte-prompt {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.lsqz-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.lsqz-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.lsqz-input, .lsqz-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.lsqz-input:focus, .lsqz-textarea:focus {
    border-color: #16a34a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.lsqz-answer-area {
    margin-top: 24px;
}

.lsqz-counter {
    text-align: right;
    font-size: 12px;
    margin-top: 6px;
    font-weight: bold;
    color: #64748b;
}

.lsqz-btn {
    background: #0f172a;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.lsqz-btn:hover {
    background: #1e293b;
}

.lsqz-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.lsqz-btn.outline {
    background: transparent;
    color: #0f172a;
    border: 2px solid #0f172a;
    margin-top: 10px;
}

.lsqz-btn.cta {
    background: #16a34a;
}

.lsqz-status {
    margin-top: 16px;
}

.lsqz-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.lsqz-alert.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.lsqz-loading {
    background: #f0fdf4;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Result Styles */
.lsqz-result-header {
    text-align: center;
    margin-bottom: 30px;
}

.lsqz-overall-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #166534;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.lsqz-overall-circle .val {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.lsqz-overall-circle .lbl {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.7;
}

.lsqz-score-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lsqz-score-label {
    width: 100px;
    font-size: 13px;
    font-weight: 600;
}

.lsqz-score-bar {
    flex-grow: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.lsqz-score-bar span {
    display: block;
    height: 100%;
    background: #16a34a;
}

.lsqz-score-num {
    width: 30px;
    text-align: right;
    font-weight: bold;
    font-size: 14px;
}

.lsqz-feedback-box, .lsqz-recommendation {
    margin-top: 24px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.lsqz-feedback-box h4, .lsqz-recommendation h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lsqz-paywall {
    text-align: center;
    background: #f0fdf4;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.lsqz-paywall p {
    margin: 0 0 16px;
    font-weight: 600;
    color: #14532d;
}

.lsqz-remaining {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 12px;
}

/* ── Blur overlay & password gate ───────────────────────────────────────── */
.lsqz-blur-wrapper {
    position: relative;
}

.lsqz-blur-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.lsqz-is-blurred {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

.lsqz-password-gate {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.lsqz-password-gate p {
    margin: 0 0 16px;
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.lsqz-password-row {
    display: flex;
    gap: 8px;
}

.lsqz-password-row .lsqz-input {
    flex: 1;
}

.lsqz-password-row .lsqz-btn {
    width: auto;
    padding: 10px 20px;
}

/* ── Header layout ───────────────────────────────────────────────────────── */
.lsqz-pte-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.lsqz-pte-header-left {
    flex: 1;
}

.lsqz-pte-type-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.lsqz-pte-header h2 {
    font-size: 20px;
    margin: 0;
}

.lsqz-pte-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    flex-shrink: 0;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.lsqz-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.lsqz-tool-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    color: #475569;
    transition: background .15s;
}

.lsqz-tool-btn:hover {
    background: #e2e8f0;
}

/* ── Counter bar ─────────────────────────────────────────────────────────── */
.lsqz-counter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
}

.lsqz-counter-num {
    font-weight: 700;
}

.lsqz-counter-range {
    color: #94a3b8;
}

/* ── Actions row ─────────────────────────────────────────────────────────── */
.lsqz-actions {
    margin-top: 20px;
}

.lsqz-result-actions {
    margin-top: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .lsqz-pte-container .card { padding: 18px; }
    .lsqz-score-label { width: 80px; font-size: 12px; }
    .lsqz-score-num { width: 28px; font-size: 13px; }
    .lsqz-overall-circle { width: 68px; height: 68px; }
    .lsqz-overall-circle .val { font-size: 24px; }
}

@media (max-width: 480px) {
    .lsqz-pte-container .card { padding: 14px 12px; border-radius: 10px; }

    /* Header: title stacks above timer */
    .lsqz-pte-header { flex-direction: column; gap: 10px; }
    .lsqz-pte-timer { align-self: flex-start; font-size: 14px; padding: 7px 12px; }

    /* Toolbar wraps */
    .lsqz-toolbar { flex-wrap: wrap; }
    .lsqz-tool-btn { font-size: 11px; padding: 5px 10px; }

    /* Form */
    .lsqz-form-grid { grid-template-columns: 1fr; }

    /* Password gate */
    .lsqz-password-row { flex-direction: column; }
    .lsqz-password-row .lsqz-btn { width: 100%; }

    /* Score bars */
    .lsqz-score-label { width: 80px; font-size: 11px; }
    .lsqz-score-num { width: 24px; font-size: 12px; }

    /* Overall circle */
    .lsqz-overall-circle { width: 64px; height: 64px; }
    .lsqz-overall-circle .val { font-size: 20px; }

    /* Result actions */
    .lsqz-result-actions { text-align: left; }
    .lsqz-result-actions .lsqz-btn { display: block; width: 100%; margin-bottom: 8px; }

    /* Instruction block */
    .lsqz-pte-instruction { padding: 10px 12px; font-size: 13px; }
}
