/* =================================================================
   /assets/css/tools/pricing-vote.css

   Styles for the Price & Value Validator vote page (public voter-facing).
   Loaded automatically by index.php via tool_definitions query.
   Extends tool-base.css (shared pv-* classes).

   Teal/price-check metaphor. No hardcoded colors — works in dark theme.
   ================================================================= */

/* ── Intro: icon scene ── */
.prv-intro-icon-scene {
    display: flex;
    justify-content: center;
    margin: 1rem 0 0.5rem;
}

.prv-intro-icon {
    font-size: 3rem;
    color: var(--peritiq-accent-signal);
    opacity: 0.85;
    animation: prvPulse 2s ease-in-out infinite;
}

@keyframes prvPulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.05); }
}

/* ── Meta chips row (items count, time, currency) ── */
.prv-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    margin: 0.5rem 0 0.75rem;
}

/* ── Price input compound row ── */
.prv-field {
    margin-bottom: 1rem;
}

.prv-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--peritiq-text-primary);
}

.prv-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 8px;
    font-size: 0.92rem;
    background: var(--peritiq-background-base);
    color: var(--peritiq-text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: var(--peritiq-font-body);
}

.prv-input:focus {
    outline: none;
    border-color: var(--peritiq-accent-signal);
    box-shadow: 0 0 0 3px rgba(0, 128, 133, 0.15);
}

.prv-textarea {
    resize: vertical;
    min-height: 60px;
}

.prv-optional {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.82rem;
}

.prv-price-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prv-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--peritiq-text-secondary);
    min-width: 24px;
}

.prv-price-input .prv-input {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px;
}

.prv-cycle {
    font-size: 0.82rem;
    color: var(--peritiq-text-secondary);
    white-space: nowrap;
}

/* ── Layer sections ── */
.prv-layer {
    margin-bottom: 1.25rem;
}

.prv-layer:last-child {
    margin-bottom: 0;
}

.prv-section-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--peritiq-text-primary);
}

/* ── Purchase intent rows ── */
.prv-intent-row {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--peritiq-border-primary);
}

.prv-intent-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.prv-intent-price {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--peritiq-text-primary);
}

.prv-intent-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prv-intent-chip {
    padding: 6px 14px;
    border: 1.5px solid var(--peritiq-border-primary);
    border-radius: 20px;
    background: var(--peritiq-background-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--peritiq-text-secondary);
    font-family: var(--peritiq-font-body);
    user-select: none;
}

.prv-intent-chip:hover {
    border-color: rgba(0, 128, 133, 0.4);
    background: rgba(0, 128, 133, 0.05);
}

.prv-intent-chip.selected {
    background: var(--peritiq-accent-signal);
    border-color: var(--peritiq-accent-signal);
    color: var(--peritiq-text-inverse);
    font-weight: 600;
}

/* ── Value driver chips (customer ranking) ── */
.prv-driver-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
    justify-content: center;
}

.prv-driver-chip {
    padding: 8px 18px;
    border: 1.5px solid var(--peritiq-border-primary);
    border-radius: 24px;
    background: var(--peritiq-background-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--peritiq-text-secondary);
    font-family: var(--peritiq-font-body);
    user-select: none;
    white-space: nowrap;
}

.prv-driver-chip:hover {
    border-color: rgba(0, 128, 133, 0.4);
    background: rgba(0, 128, 133, 0.05);
    color: var(--peritiq-text-primary);
}

.prv-driver-chip.selected {
    border-color: var(--peritiq-accent-signal);
    background: rgba(0, 128, 133, 0.1);
    color: var(--peritiq-text-primary);
    font-weight: 600;
}

.prv-driver-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--peritiq-accent-signal);
    color: var(--peritiq-text-inverse);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prv-selected-count {
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    text-align: center;
    margin-top: 0.25rem;
}

/* ── Value driver allocation (internal 100-point) ── */
.prv-alloc-budget {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--peritiq-background-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--peritiq-text-primary);
}

.prv-alloc-budget.complete {
    background: rgba(0, 128, 133, 0.1);
    color: var(--peritiq-accent-signal);
}

.prv-alloc-budget.over {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.prv-alloc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
}

.prv-alloc-label {
    flex: 1;
    font-size: 0.85rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--peritiq-text-primary);
}

.prv-alloc-bar-wrap {
    width: 80px;
    height: 8px;
    border-radius: 4px;
    background: var(--peritiq-border-primary);
    overflow: hidden;
    flex-shrink: 0;
}

.prv-alloc-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--peritiq-brand-primary), var(--peritiq-brand-primary-hover));
    border-radius: 4px;
    transition: width 0.2s;
}

.prv-alloc-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.prv-alloc-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 6px;
    background: var(--peritiq-background-base);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--peritiq-text-primary);
}

.prv-alloc-btn:hover:not(:disabled) {
    border-color: var(--peritiq-accent-signal);
    background: rgba(0, 128, 133, 0.08);
}

.prv-alloc-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.prv-alloc-value {
    font-size: 0.88rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--peritiq-text-primary);
}

/* ── Review Screen — price summary + drivers + notes ── */
.prv-review-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--peritiq-border-primary);
}

.prv-review-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0.75rem;
}

.prv-review-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--peritiq-text-secondary);
    margin-bottom: 0.75rem;
}

.prv-review-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--peritiq-surface-overlay);
}

.prv-review-item:last-child {
    border-bottom: none;
}

.prv-review-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--peritiq-text-primary);
    margin-bottom: 6px;
    line-height: 1.35;
}

.prv-review-item-prices {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.prv-review-price {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--peritiq-accent-signal);
    font-variant-numeric: tabular-nums;
}

.prv-review-price-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--peritiq-text-secondary);
}

.prv-review-price-ceil {
    color: var(--peritiq-text-secondary);
    font-weight: 600;
}

/* Price range bar — expected vs ceiling visual */
.prv-review-range-bar {
    position: relative;
    height: 4px;
    border-radius: 2px;
    background: var(--peritiq-border-primary);
    margin-top: 6px;
    overflow: hidden;
}

.prv-review-range-ceiling {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 128, 133, 0.15);
    border-radius: 2px;
}

.prv-review-range-expected {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--peritiq-brand-primary), var(--peritiq-brand-primary-hover));
    border-radius: 2px;
    z-index: 1;
}

/* Driver rows — allocation mode (pts) */
.prv-review-driver {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--peritiq-surface-overlay);
}

.prv-review-driver:last-child {
    border-bottom: none;
}

.prv-review-driver-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--peritiq-text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prv-review-driver-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--peritiq-accent-signal);
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Driver allocation bar (review) */
.prv-review-driver-bar {
    width: 60px;
    height: 6px;
    border-radius: 3px;
    background: var(--peritiq-border-primary);
    overflow: hidden;
    flex-shrink: 0;
}

.prv-review-driver-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--peritiq-brand-primary), var(--peritiq-brand-primary-hover));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Driver rows — ranking mode (#rank) */
.prv-review-driver-rank {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--peritiq-accent-signal);
    min-width: 28px;
    flex-shrink: 0;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

/* Freetext note in review */
.prv-review-freetext {
    font-size: 0.82rem;
    color: var(--peritiq-text-secondary);
    font-style: italic;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--peritiq-background-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--peritiq-accent-signal);
}

/* ── Validation toast ── */
/* legacy — moved to tool-base.css as .pv-validation-toast */

/* ── Mobile ── */
@media (max-width: 480px) {
    .prv-intent-options {
        flex-direction: column;
    }

    .prv-intent-chip {
        text-align: center;
    }

    .prv-alloc-row {
        flex-wrap: wrap;
    }

    .prv-alloc-bar-wrap {
        width: 100%;
        order: 3;
    }

    .prv-driver-chip {
        white-space: normal;
        text-align: center;
        justify-content: center;
    }

    .prv-price-input .prv-input {
        font-size: 1rem;
    }

    .prv-review-item-prices {
        flex-direction: column;
        gap: 6px;
    }

    .prv-review-price {
        font-size: 0.92rem;
    }
}

/* ── Tablet ── */
@media (min-width: 481px) and (max-width: 768px) {
    .prv-alloc-bar-wrap {
        width: 60px;
    }
}
