/**
 * CQA Public Submission Portal — Styles
 *
 * Modern, clean aesthetic for the public submission form.
 * Self-contained — does not depend on admin.css.
 */

/* ─── Portal Container ───────────────────────────────────────────── */

.cqa-portal {
    max-width: 720px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.cqa-portal-disabled {
    max-width: 720px;
    margin: 40px auto;
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
}

/* ─── Steps ──────────────────────────────────────────────────────── */

.cqa-step {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.cqa-step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.cqa-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.cqa-step-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.cqa-step-body {
    padding: 24px;
}

.cqa-step-body p {
    color: #64748b;
    margin-bottom: 16px;
}

/* ─── Form Elements ──────────────────────────────────────────────── */

.cqa-field-group {
    margin-bottom: 20px;
}

.cqa-field-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.cqa-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cqa-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cqa-input-small {
    max-width: 200px;
}

.cqa-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #ffffff;
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cqa-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cqa-word-count {
    text-align: right;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

.cqa-upload-description {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.cqa-inline-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ─── Buttons ────────────────────────────────────────────────────── */

.cqa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.cqa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cqa-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.cqa-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cqa-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #d1d5db;
}

.cqa-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.cqa-btn-provider {
    background: white;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    padding: 14px 28px;
    font-size: 15px;
    min-width: 200px;
}

.cqa-btn-provider:hover:not(:disabled) {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cqa-btn.cqa-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.cqa-btn.cqa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: cqa-spin 0.6s linear infinite;
}

/* ─── Fee Summary ────────────────────────────────────────────────── */

.cqa-fee-summary {
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 15px;
}

.cqa-fee-summary p {
    margin: 0;
    color: #1e293b;
}

.cqa-fee-summary strong {
    color: #2563eb;
    font-size: 18px;
}

.cqa-payment-providers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ─── Messages ───────────────────────────────────────────────────── */

.cqa-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    margin-top: 12px;
}

.cqa-info {
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    color: #1d4ed8;
    font-size: 14px;
    margin-top: 8px;
}

.cqa-success-message {
    padding: 16px 20px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    margin-bottom: 16px;
}

.cqa-error-message {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    margin-bottom: 16px;
}

/* ─── Score Card ──────────────────────────────────────────────────── */

.cqa-score-card {
    text-align: center;
    padding: 24px;
    margin-bottom: 20px;
}

.cqa-overall-score {
    margin-bottom: 24px;
}

.cqa-score-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.cqa-score-value {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: #1e293b;
}

.cqa-score-max {
    font-size: 24px;
    color: #94a3b8;
    font-weight: 400;
}

.cqa-score-high {
    color: #16a34a !important;
}

.cqa-score-medium {
    color: #d97706 !important;
}

.cqa-score-low {
    color: #dc2626 !important;
}

.cqa-sub-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cqa-sub-score {
    padding: 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cqa-sub-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cqa-sub-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

/* ─── Feedback Box ───────────────────────────────────────────────── */

.cqa-feedback-box {
    padding: 16px 20px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
}

.cqa-feedback-box h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #374151;
}

/* ─── Loading Spinner ────────────────────────────────────────────── */

.cqa-loading {
    text-align: center;
    padding: 40px;
}

.cqa-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: cqa-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes cqa-spin {
    to { transform: rotate(360deg); }
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .cqa-portal {
        margin: 20px 16px;
    }

    .cqa-step-body {
        padding: 16px;
    }

    .cqa-sub-scores {
        grid-template-columns: repeat(2, 1fr);
    }

    .cqa-payment-providers {
        flex-direction: column;
    }

    .cqa-btn-provider {
        min-width: auto;
        width: 100%;
    }

    .cqa-inline-group {
        flex-direction: column;
        align-items: stretch;
    }

    .cqa-input-small {
        max-width: none;
    }
}

/* ─── Mini Score Card (Step 4) ────────────────────────────────────── */
.cqa-score-card.mini {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
}

.cqa-score-card.mini .cqa-overall-score {
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cqa-score-card.mini .cqa-score-value {
    font-size: 32px;
}

.cqa-score-card.mini .cqa-score-max {
    font-size: 14px;
}

.cqa-score-card.mini .cqa-sub-scores {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex-grow: 1;
}

.cqa-score-card.mini .cqa-sub-score {
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.cqa-score-card.mini .cqa-sub-label {
    margin-bottom: 0;
    font-size: 11px;
}

.cqa-score-card.mini .cqa-sub-value {
    font-size: 16px;
}

/* ─── 3-Tier Editorial Verdict Card ──────────────────────────────── */
.cqa-verdict-card {
    padding: 18px 22px;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.cqa-verdict-ready {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #86efac;
}
.cqa-verdict-ready .cqa-verdict-badge {
    background: #16a34a;
    color: #ffffff;
}
.cqa-verdict-ready .cqa-verdict-title {
    color: #166534;
}
.cqa-verdict-ready .cqa-verdict-desc {
    color: #14532d;
}

.cqa-verdict-polish {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fcd34d;
}
.cqa-verdict-polish .cqa-verdict-badge {
    background: #d97706;
    color: #ffffff;
}
.cqa-verdict-polish .cqa-verdict-title {
    color: #92400e;
}
.cqa-verdict-polish .cqa-verdict-desc {
    color: #78350f;
}

.cqa-verdict-rescue {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1.5px solid #d8b4fe;
}
.cqa-verdict-rescue .cqa-verdict-badge {
    background: #7c3aed;
    color: #ffffff;
}
.cqa-verdict-rescue .cqa-verdict-title {
    color: #581c87;
}
.cqa-verdict-rescue .cqa-verdict-desc {
    color: #4c1d95;
}

.cqa-verdict-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Polish Upgrade Box ─────────────────────────────────────────── */
.cqa-polish-upgrade-box {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cqa-polish-upgrade-box:hover {
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.15);
}

/* ─── Link Architecture & Citations ──────────────────────────────── */
.cqa-link-architecture-box {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cqa-citation-item {
    transition: background 0.2s ease, border-color 0.2s ease;
}
.cqa-citation-item:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
