/* TrotsPellissier Advertising — Public Styles */

/* ── Colour theme tokens (overridden via wp_head dynamic CSS) ── */
:root {
    --tp-primary:        #1a3c5e;   /* main brand colour */
    --tp-primary-dark:   #0f2640;   /* hover / pressed */
    --tp-primary-light:  #f0f6ff;   /* tinted background */
    --tp-primary-border: #c5d8f0;   /* tinted border */
    --tp-primary-text:   #ffffff;   /* text on primary bg */

    /* Semantic colours — not themeable */
    --tp-success:        #2e7d32;
    --tp-success-light:  #e8f5e9;
    --tp-success-border: #c8e6c9;
    --tp-warning:        #f0b429;
    --tp-danger:         #c00;
    --tp-neutral:        #c5d2dc;
    --tp-muted:          #6b8099;
}

/* ── Ad display ── */
.tp-ad-wrapper         { text-align: center; margin: 20px auto; }
.tp-align-left         { text-align: left; }
.tp-align-right        { text-align: right; }
.tp-injected-ad        { margin: 24px auto; text-align: center; clear: both; }

.tp-ad-slot            { display: inline-block; position: relative; max-width: 100%; overflow: hidden; }
.tp-ad-slot img        { display: block; max-width: 100%; height: auto; }
.tp-ad-label           { display: block; font-size: 10px; color: #aaa; text-align: right; margin-top: 2px; font-style: italic; }

.tp-ad-empty           {
    display: flex; align-items: center; justify-content: center;
    background: #f0f4f8; border: 2px dashed var(--tp-neutral);
    color: var(--tp-muted); font-size: 13px; text-align: center;
    padding: 10px;
}

/* ── Submission form ── */
.tp-submission-form-wrap {
    max-width: 760px;
    margin: 0 auto;
    font-family: inherit;
}

/* Steps indicator */
.tp-steps {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--tp-neutral);
}

.tp-step {
    flex: 1;
    padding: 12px 16px;
    background: #f0f4f8;
    color: var(--tp-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-right: 1px solid var(--tp-neutral);
}

.tp-step:last-child { border-right: none; }
.tp-step span {
    display: inline-block;
    width: 22px; height: 22px;
    line-height: 22px;
    border-radius: 50%;
    background: var(--tp-neutral);
    color: #fff;
    font-size: 12px;
    margin-right: 6px;
}
.tp-step.active { background: var(--tp-primary); color: var(--tp-primary-text); }
.tp-step.active span { background: var(--tp-primary-text); color: var(--tp-primary); }
.tp-step.done { background: var(--tp-success-light); color: var(--tp-success); }
.tp-step.done span { background: var(--tp-success); color: #fff; }

/* Fields */
.tp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .tp-field-row { grid-template-columns: 1fr; } }

.tp-field { margin-bottom: 18px; }
.tp-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: #333; }
.tp-field input[type="text"],
.tp-field input[type="email"],
.tp-field input[type="tel"],
.tp-field input[type="url"],
.tp-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tp-neutral);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    color: #333;
    transition: border-color 0.2s;
}
.tp-field input:focus,
.tp-field textarea:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tp-primary) 15%, transparent);
}

.tp-help { font-size: 12px; color: #777; margin-top: 5px; }
.req     { color: var(--tp-danger); }

/* Size grid */
.tp-size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.tp-size-card { cursor: pointer; }
.tp-size-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.tp-size-card-inner {
    display: flex; flex-direction: column;
    border: 2px solid var(--tp-neutral);
    border-radius: 6px;
    padding: 14px 12px;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 4px;
    cursor: pointer;
}

.tp-size-card input:checked + .tp-size-card-inner {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-primary) 15%, transparent);
    background: var(--tp-primary-light);
}

.tp-size-name  { font-weight: 700; font-size: 14px; color: var(--tp-primary); }
.tp-size-dims  { font-size: 12px; color: #888; }
.tp-size-price { font-size: 13px; color: var(--tp-success); font-weight: 600; }
.tp-size-desc  { font-size: 11px; color: #999; margin-top: 4px; }

/* Plan grid */
.tp-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 10px;
}
@media (max-width:600px) { .tp-plan-grid { grid-template-columns: 1fr; } }

.tp-plan-card { cursor: pointer; }
.tp-plan-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.tp-plan-inner {
    display: flex; flex-direction: column; gap: 4px;
    border: 2px solid var(--tp-neutral);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.tp-plan-card input:checked + .tp-plan-inner {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-primary) 15%, transparent);
    background: var(--tp-primary-light);
}

.tp-plan-name     { font-weight: 700; font-size: 15px; color: var(--tp-primary); }
.tp-plan-duration { font-size: 12px; color: #888; }
.tp-plan-price    { font-size: 20px; font-weight: 700; color: var(--tp-success); margin: 4px 0; }
.tp-plan-save     { font-size: 11px; color: #f57c00; font-weight: 600; background: #fff8e1; border-radius: 10px; padding: 2px 8px; display: inline-block; margin-top: 4px; }

/* Price summary */
.tp-price-summary {
    background: var(--tp-primary-light);
    border: 1px solid var(--tp-primary-border);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 16px 0;
}

.tp-price-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: #555; }
.tp-price-total { border-top: 1px solid var(--tp-primary-border); margin-top: 8px; padding-top: 10px; font-size: 18px; }
.tp-price-total strong { color: var(--tp-primary); font-size: 20px; }

/* Bank teaser */
.tp-bank-teaser {
    background: var(--tp-success-light);
    border-left: 4px solid var(--tp-success);
    border-radius: 4px;
    padding: 12px 16px;
    margin: 16px 0;
}
.tp-bank-teaser h4 { margin: 0 0 6px; color: #1b5e20; }
.tp-bank-teaser p  { margin: 0; font-size: 14px; color: #388e3c; }

/* Buttons */
.tp-form-nav { display: flex; gap: 12px; margin-top: 20px; align-items: center; }

.tp-btn {
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s, background 0.15s;
}

.tp-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tp-btn-primary   { background: var(--tp-primary); color: var(--tp-primary-text); }
.tp-btn-primary:hover { background: var(--tp-primary-dark); }
.tp-btn-secondary { background: #e0e0e0; color: #333; }
.tp-btn-secondary:hover { background: #ccc; }
.tp-btn-outline   { background: transparent; border: 2px solid var(--tp-primary); color: var(--tp-primary); padding: 10px 20px; }
.tp-btn-outline:hover { background: var(--tp-primary); color: var(--tp-primary-text); }

/* Error box */
.tp-error-box {
    background: #fde8e8;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 12px;
}

/* Success box */
.tp-success-box {
    background: var(--tp-success-light);
    border: 2px solid var(--tp-success);
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 24px;
}
.tp-success-box h2 { color: #1b5e20; margin-top: 0; }

.tp-summary-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.tp-summary-table th,
.tp-summary-table td { padding: 8px 12px; border-bottom: 1px solid var(--tp-success-border); text-align: left; font-size: 14px; }
.tp-summary-table th { width: 40%; color: #555; font-weight: 600; }

.tp-bank-box { background: #fff; border: 1px solid var(--tp-success-border); border-radius: 6px; padding: 16px; margin-top: 16px; }
.tp-bank-box h3 { margin-top: 0; color: #1b5e20; }

.tp-important { background: #fff8e1; border-left: 3px solid #f57c00; padding: 10px 14px; font-size: 13px; color: #e65100; border-radius: 3px; margin-top: 12px; }

/* My ads */
.tp-my-ads-wrap        { max-width: 800px; margin: 0 auto; }
.tp-my-ad-card         { display: flex; gap: 20px; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-bottom: 16px; background: #fff; }
.tp-my-ad-img          { flex-shrink: 0; }
.tp-my-ad-info         { flex: 1; }
.tp-my-ad-info h4      { margin: 0 0 12px; color: var(--tp-primary); }
.tp-info-table         { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-info-table th, .tp-info-table td { padding: 5px 8px; border-bottom: 1px solid #eee; text-align: left; }
.tp-info-table th      { width: 35%; color: #666; font-weight: 600; }
.tp-admin-note         { background: #fff8e1; border-left: 3px solid var(--tp-warning); padding: 8px 12px; margin-top: 12px; font-size: 13px; color: #555; border-radius: 3px; }

@media (max-width: 600px) {
    .tp-my-ad-card { flex-direction: column; }
}

/* Image preview */
#tp-image-preview img { border-radius: 4px; }

/* Spinner for form submit */
.tp-spinner::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tp-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }
