/**
 * Piston Tribe — Trustap Checkout Styles
 * Covers: Direct Buy flow, deposit modal, Trustap redirect button states.
 */

/* Placeholder — styles for the Trustap checkout flow live in
   single-listing.php (inline) and the global Noir stylesheet.
   This file exists to prevent the browser 404. */

/* ── Inspection Status Banner (top of chat) ─────────────────── */
.pt-insp-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-left: 3px solid;
    font-size: 13px;
    line-height: 1.55;
}

.pt-insp-banner--buyer {
    background: #0c1508;
    border-color: #16a34a;
    color: #d1fae5;
}

.pt-insp-banner--seller {
    background: #0f0e08;
    border-color: #ca8a04;
    color: #fef9c3;
}

.pt-insp-banner__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.pt-insp-banner--buyer .pt-insp-banner__icon  { stroke: #4ade80; }
.pt-insp-banner--seller .pt-insp-banner__icon { stroke: #fbbf24; }

.pt-insp-banner__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pt-insp-banner__body strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.pt-insp-banner--buyer  .pt-insp-banner__body strong { color: #4ade80; }
.pt-insp-banner--seller .pt-insp-banner__body strong { color: #fbbf24; }

.pt-insp-banner__body span {
    font-size: 12px;
    opacity: 0.85;
}

/* ── Seller Claim Funds button ───────────────────────────────── */
.pt-insp-btn--claim {
    width: 100%;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    display: block;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pt-insp-btn--claim-waiting {
    background: #1a1a1a;
    color: #4b5563;
    border: 1px solid #2a2a2a;
    cursor: not-allowed;
}

.pt-insp-btn--claim-ready {
    background: #10b981;
    color: #fff;
    cursor: pointer;
    border: 1px solid transparent;
}

.pt-insp-btn--claim-ready:hover:not(:disabled) {
    background: #059669;
}

/* Don't dim the waiting button — the muted colour communicates state */
.pt-insp-btn--claim-waiting:disabled { opacity: 1; }

/* ── Inspection Period Card ─────────────────────────────────── */
.pt-inspection-card {
    border-left: 3px solid #f59e0b !important;
}

/* Countdown digits */
.pt-countdown {
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    padding: 20px 16px 14px;
    margin: 14px 0 12px;
    text-align: center;
}

.pt-cd-digits {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.pt-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pt-cd-num {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.02em;
    min-width: 2ch;
    display: inline-block;
    text-align: center;
    transition: color 0.3s;
}

.pt-cd-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4b5563;
    margin-top: 4px;
}

.pt-cd-sep {
    font-size: 28px;
    font-weight: 800;
    color: #374151;
    line-height: 1;
    padding-bottom: 14px;
    align-self: flex-start;
    padding-top: 2px;
}

/* Progress bar */
.pt-cd-bar-wrap {
    height: 2px;
    background: #1f1f1f;
    margin: 0 0 10px;
}

.pt-cd-bar {
    height: 100%;
    background: #f59e0b;
    transition: width 1s linear;
}

.pt-cd-ends {
    font-size: 11px;
    color: #4b5563;
    margin: 0;
}

/* Warning: < 1 hour remaining */
.pt-cd--warn .pt-cd-num { color: #f87171; }
.pt-cd--warn .pt-cd-bar { background: #cc0000; }

/* Action buttons */
.pt-insp-note {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 14px;
}

.pt-insp-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pt-insp-btn {
    display: block;
    width: 100%;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
    line-height: 1;
}

.pt-insp-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pt-insp-btn--release {
    background: #fff;
    color: #111;
}
.pt-insp-btn--release:hover:not(:disabled) { background: #10b981; color: #fff; }

.pt-insp-btn--dispute {
    background: transparent;
    color: #f87171;
    border: 1px solid #3d1515;
}
.pt-insp-btn--dispute:hover { background: #1a0707; border-color: #cc0000; color: #ff6b6b; }

.pt-insp-msg {
    font-size: 12px;
    min-height: 16px;
    margin-top: 8px;
}

/* Status states (complete, dispute, releasing) */
.pt-insp-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.pt-insp-status--done {
    background: #071a0f;
    border: 1px solid #1a3a25;
    color: #10b981;
}

.pt-insp-status--dispute {
    background: #140b00;
    border: 1px solid #3d2200;
    color: #f59e0b;
}

.pt-insp-status--releasing {
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    color: #9ca3af;
    margin-top: 12px;
}

.pt-insp-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.pt-insp-check {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* ── F2F Handover QR — animated checkmark ───────────────────── */
.pt-handover-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 4px;
}

.pt-handover-done--hidden {
    display: none;
}

.pt-handover-done--animate {
    display: flex;
    animation: ptFadeIn 0.4s ease forwards;
}

@keyframes ptFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pt-handover-check {
    width: 56px;
    height: 56px;
}

.pt-check-circle {
    stroke: #10b981;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-linecap: round;
    animation: ptDrawCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.pt-handover-done--animate .pt-check-circle,
.pt-handover-done:not(.pt-handover-done--hidden) .pt-check-circle {
    animation: ptDrawCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.pt-check-mark {
    stroke: #10b981;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: ptDrawCheck 0.4s 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.pt-handover-done--animate .pt-check-mark,
.pt-handover-done:not(.pt-handover-done--hidden) .pt-check-mark {
    animation: ptDrawCheck 0.4s 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes ptDrawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes ptDrawCheck {
    to { stroke-dashoffset: 0; }
}

/* ── Transaction Feedback Form ───────────────────────────── */
.pt-feedback-form-wrap {
    margin-top: 20px;
    border-top: 1px solid #1f1f1f;
    padding-top: 16px;
}

.pt-fb-label {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 12px;
    line-height: 1.5;
}

.pt-fb-label strong {
    color: #e5e7eb;
}

/* Piston row */
.pt-fb-pistons {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.pt-fb-piston {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #4b5563;
    font-size: 22px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}

.pt-fb-piston:hover,
.pt-fb-piston--active {
    background: #1a2a1a;
    border-color: #10b981;
    color: #fff;
}

/* Comment textarea */
.pt-fb-comment {
    width: 100%;
    background: #111;
    border: 1px solid #2a2a2a;
    color: #e5e7eb;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 0;
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.pt-fb-comment:focus {
    outline: none;
    border-color: #10b981;
}

.pt-fb-comment::placeholder {
    color: #4b5563;
}

/* Submit button */
.pt-fb-submit {
    width: 100%;
    padding: 13px 18px;
    background: #10b981;
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s;
    line-height: 1;
}

.pt-fb-submit:hover:not(:disabled) {
    background: #059669;
}

.pt-fb-submit:disabled {
    background: #1a1a1a;
    color: #4b5563;
    border: 1px solid #2a2a2a;
    cursor: not-allowed;
}

/* Inline message */
.pt-fb-msg {
    font-size: 12px;
    color: #f87171;
    min-height: 16px;
    margin: 8px 0 0;
}

/* Submitted state */
.pt-feedback-submitted {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #071a0f;
    border: 1px solid #1a3a25;
    color: #10b981;
    font-size: 13px;
    font-weight: 600;
}

.pt-fb-check {
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Verified purchase tick on .pt-trust-inline ──────────── */
.pt-trust-verified-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #10b981;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    cursor: default;
    flex-shrink: 0;
}
