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

.ls-ielts-speaking-wrapper + p:empty,
.lsqz-ielts-speaking-container + p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Container ───────────────────────────────────────────────────────────── */
.lsqz-speaking-container {
    max-width: 780px;
    margin: var(--quiz-head-gap, 24px) auto var(--quiz-bottom-gap, 32px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.lsqz-speaking-header {
    margin-bottom: 4px;
}

.lsqz-speaking-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.lsqz-speaking-header h2 {
    font-size: 18px;
    margin: 0 0 4px;
}

.lsqz-speaking-instruction {
    color: #475569;
    font-size: 14px;
}

/* ── Cue Card (Part 2) ───────────────────────────────────────────────────── */
.lsqz-cue-card {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 16px 0;
}

.lsqz-cue-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #92400e;
    margin-bottom: 8px;
}

.lsqz-cue-card-content {
    font-size: 15px;
    line-height: 1.7;
    color: #1e293b;
    white-space: pre-wrap;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.lsqz-speaking-container .card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fcfdff;
}

.lsqz-speaking-image,
.lsqz-speaking-audio,
#lsqz-ielts-audio-preview { width: 100%; }

/* ── Blur overlay ─────────────────────────────────────────────────────────── */
.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(255,255,255,.4);
    backdrop-filter: blur(2px);
    border-radius: 14px;
}

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

#lsqz-ielts-start-now-btn {
    font-size: 18px;
    padding: 16px 32px;
    box-shadow: 0 10px 25px rgba(15,23,42,.2);
    transition: transform .2s, box-shadow .2s;
}

#lsqz-ielts-start-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(15,23,42,.3);
}

/* ── Recorder main row ───────────────────────────────────────────────────── */
.lsqz-recorder-main {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.lsqz-record-countdown-btn {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 20px;
    border-radius: 12px;
    line-height: 1.3;
    transition: background .2s;
    word-break: break-word;
}

.lsqz-record-countdown-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lsqz-record-countdown-btn.lsqz-recording {
    background: #dc2626;
    animation: lsqz-pulse 1.2s ease-in-out infinite;
}

@keyframes lsqz-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); }
    50%       { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
}

.lsqz-reset-btn {
    flex: 0 0 auto;
    padding: 16px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.lsqz-recorder-status {
    color: #475569;
    font-size: 13px;
    margin-top: 10px;
}

/* ── Submit / confirm ─────────────────────────────────────────────────────── */
.lsqz-submit-main-btn {
    width: 100%;
    font-size: 15px;
    padding: 15px;
    border-radius: 12px;
}

/* ── Identity panel ──────────────────────────────────────────────────────── */
.lsqz-identity-panel {
    margin-top: 16px;
    padding: 18px;
    border: 1.5px solid #bbf7d0;
    border-radius: 14px;
    background: #f0fdf4;
    animation: lsqz-slide-down .22s ease;
}

@keyframes lsqz-slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lsqz-identity-intro {
    margin: 0 0 14px;
    color: #166534;
    font-weight: 600;
    font-size: 14px;
}

.lsqz-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

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

.lsqz-input {
    width: 100%;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}

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

.lsqz-confirm-submit-btn {
    background: #16a34a;
    width: 100%;
    font-size: 15px;
    padding: 13px;
    border-radius: 11px;
}

.lsqz-confirm-submit-btn:hover:not(:disabled) {
    background: #15803d;
}

/* ── Shared button ───────────────────────────────────────────────────────── */
.lsqz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 18px;
    cursor: pointer;
}

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

.lsqz-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.lsqz-btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.lsqz-alert {
    padding: 11px 14px;
    border-radius: 10px;
    margin-top: 14px;
    font-size: 14px;
}

.lsqz-alert.is-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.lsqz-alert.is-info, .lsqz-paywall { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── Result box ──────────────────────────────────────────────────────────── */
.lsqz-result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.lsqz-result-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

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

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

.lsqz-scores-grid {
    margin: 16px 0;
}

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

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

.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-result-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.lsqz-result-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

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

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

.lsqz-transcript-box {
    white-space: pre-wrap;
    background: #f8fafc;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid #e2e8f0;
}

.lsqz-result-banner { margin-top: 16px; text-align: center; }
.lsqz-result-banner img { max-width: 100%; border-radius: 8px; }

.lsqz-remaining { color: #475569; font-size: 13px; }

/* ── Password gate ───────────────────────────────────────────────────────── */
.lsqz-password-gate {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15,23,42,.15);
    max-width: 320px;
    width: 90%;
}

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

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

.lsqz-password-row .lsqz-input {
    flex: 1;
    border-color: #cbd5e1;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .lsqz-speaking-container { padding: 20px 16px; }
    .lsqz-form-grid { grid-template-columns: repeat(2, 1fr); }
    .lsqz-score-label { width: 80px; font-size: 12px; }
    .lsqz-score-num { width: 28px; font-size: 13px; }
    .lsqz-overall-circle { width: 72px; height: 72px; }
    .lsqz-overall-circle .val { font-size: 24px; }
}

@media (max-width: 600px) {
    .lsqz-speaking-container { padding: 16px 12px; border-radius: 12px; }
    .lsqz-form-grid { grid-template-columns: 1fr; }
    .lsqz-record-countdown-btn { font-size: 14px; padding: 14px 12px; }
    .lsqz-reset-btn { padding: 14px 10px; font-size: 13px; }
    .lsqz-password-row { flex-direction: column; }
    .lsqz-password-row .lsqz-btn { width: 100%; }

    /* Cue card compact */
    .lsqz-cue-card { padding: 14px 14px; }
    .lsqz-cue-card-content { font-size: 14px; }

    /* Score bars */
    .lsqz-score-label { width: 70px; 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; }
    .lsqz-overall-circle .lbl { font-size: 9px; }

    /* Result header */
    .lsqz-result-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .lsqz-result-actions { flex-direction: column; align-items: stretch; gap: 8px; }
    .lsqz-result-actions .lsqz-btn { width: 100%; text-align: center; }
}
