/* ══════════════════════════════════════════════
   PRINTCOLLECT — STYLE FRONTEND
   ══════════════════════════════════════════════ */

:root {
    --pc-primary: #6366f1;
    --pc-primary-dark: #4f46e5;
    --pc-primary-light: #e0e7ff;
    --pc-success: #10b981;
    --pc-warning: #f59e0b;
    --pc-danger: #ef4444;
    --pc-info: #3b82f6;
    --pc-gray-50: #f9fafb;
    --pc-gray-100: #f3f4f6;
    --pc-gray-200: #e5e7eb;
    --pc-gray-400: #9ca3af;
    --pc-gray-700: #374151;
    --pc-gray-900: #111827;
    --pc-radius: 12px;
    --pc-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --pc-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

#pc-app * { box-sizing: border-box; }
#pc-app { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--pc-gray-900); max-width: 1200px; margin: 0 auto; }

/* LOADING */
.pc-loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; gap: 15px; }
.pc-spinner { width: 40px; height: 40px; border: 4px solid var(--pc-primary-light); border-top-color: var(--pc-primary); border-radius: 50%; animation: pc-spin 0.8s linear infinite; }
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* HERO */
.pc-hero { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%); color: #fff; padding: 60px 30px; text-align: center; border-radius: var(--pc-radius); margin-bottom: 30px; }
.pc-hero h1 { font-size: 2.5em; margin: 0 0 10px; }
.pc-hero p { font-size: 1.1em; opacity: .9; margin: 0 0 30px; }
.pc-hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.pc-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.pc-feature-card { background: #fff; border: 1px solid var(--pc-gray-200); border-radius: var(--pc-radius); padding: 25px 20px; text-align: center; box-shadow: var(--pc-shadow); }
.pc-feature-card:hover { box-shadow: var(--pc-shadow-lg); transform: translateY(-2px); transition: all .2s; }
.pc-feature-icon { font-size: 2.5em; display: block; margin-bottom: 10px; }
.pc-feature-card h3 { margin: 0 0 8px; font-size: 1em; }
.pc-feature-card p { margin: 0; color: var(--pc-gray-400); font-size: .9em; }

/* BUTTONS */
.pc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: .95em; font-weight: 600; transition: all .15s; text-decoration: none; }
.pc-btn:disabled { opacity: .5; cursor: not-allowed; }
.pc-btn-primary { background: var(--pc-primary); color: #fff; }
.pc-btn-primary:hover:not(:disabled) { background: var(--pc-primary-dark); }
.pc-btn-outline { background: #fff; color: var(--pc-primary); border: 2px solid var(--pc-primary); }
.pc-btn-outline:hover:not(:disabled) { background: var(--pc-primary-light); }
.pc-btn-success { background: var(--pc-success); color: #fff; }
.pc-btn-danger { background: var(--pc-danger); color: #fff; }
.pc-btn-lg { padding: 14px 28px; font-size: 1.05em; border-radius: 10px; }
.pc-btn-sm { padding: 6px 14px; font-size: .85em; }
.pc-btn-full { width: 100%; }
.pc-link-btn { background: none; border: none; color: var(--pc-primary); cursor: pointer; text-decoration: underline; font-size: inherit; padding: 0; }

/* AUTH */
.pc-auth-screen { display: flex; justify-content: center; align-items: flex-start; padding: 30px 15px; min-height: 400px; }
.pc-auth-card { background: #fff; border-radius: var(--pc-radius); box-shadow: var(--pc-shadow-lg); padding: 35px; width: 100%; max-width: 480px; }
.pc-auth-header { text-align: center; margin-bottom: 25px; }
.pc-auth-header h2 { margin: 0 0 5px; font-size: 1.5em; }
.pc-auth-header p { margin: 0; color: var(--pc-gray-400); }
.pc-auth-back { text-align: center; margin-top: 20px; }

/* TABS */
.pc-tabs { display: flex; background: var(--pc-gray-100); border-radius: 8px; padding: 3px; margin-bottom: 20px; }
.pc-tab-btn { flex: 1; padding: 8px; border: none; background: none; border-radius: 6px; cursor: pointer; font-weight: 500; transition: all .15s; }
.pc-tab-btn.active { background: #fff; color: var(--pc-primary); box-shadow: var(--pc-shadow); }

/* FORMS */
.pc-form-group { margin-bottom: 15px; }
.pc-form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: .9em; color: var(--pc-gray-700); }
.pc-form-group input[type="text"],
.pc-form-group input[type="email"],
.pc-form-group input[type="password"],
.pc-form-group input[type="tel"],
.pc-form-group input[type="number"],
.pc-form-group textarea,
.pc-form-group select { width: 100%; padding: 10px 12px; border: 2px solid var(--pc-gray-200); border-radius: 8px; font-size: .95em; transition: border-color .15s; outline: none; }
.pc-form-group input:focus, .pc-form-group textarea:focus { border-color: var(--pc-primary); }
.pc-form-group textarea { min-height: 80px; resize: vertical; }
.pc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pc-checkboxes { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 5px; }
.pc-checkboxes label { font-weight: 400; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* OTP */
.pc-otp-info { text-align: center; margin-bottom: 20px; }
.pc-otp-icon { font-size: 3em; display: block; margin-bottom: 10px; }
.pc-otp-inputs { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.pc-otp-input { width: 48px; height: 56px; text-align: center; font-size: 1.5em; font-weight: 700; border: 2px solid var(--pc-gray-200); border-radius: 10px; outline: none; transition: border-color .15s; }
.pc-otp-input:focus { border-color: var(--pc-primary); }
.pc-resend { text-align: center; font-size: .9em; color: var(--pc-gray-400); margin-top: 10px; }

/* ERROR / SUCCESS */
.pc-error { background: #fef2f2; color: var(--pc-danger); border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: .9em; }
.pc-success { background: #ecfdf5; color: var(--pc-success); border: 1px solid #a7f3d0; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: .9em; }

/* DASHBOARD HEADER */
.pc-dashboard-header { background: #fff; border-bottom: 1px solid var(--pc-gray-200); padding: 15px 20px; position: sticky; top: 0; z-index: 100; margin-bottom: 20px; }
.pc-printer-header { border-top: 3px solid var(--pc-primary); }
.pc-dashboard-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pc-dashboard-title h2 { margin: 0; font-size: 1.2em; }
.pc-dashboard-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-nav-btn { padding: 8px 14px; border: 2px solid var(--pc-gray-200); background: #fff; border-radius: 8px; cursor: pointer; font-size: .85em; font-weight: 500; position: relative; transition: all .15s; }
.pc-nav-btn.active { border-color: var(--pc-primary); color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-nav-logout { color: var(--pc-danger); border-color: var(--pc-danger); }
.pc-nav-logout:hover { background: #fef2f2; }
.pc-nav-badge { background: var(--pc-danger); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .7em; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; }

/* ABO BADGE */
.pc-abo-badge { padding: 3px 10px; border-radius: 20px; font-size: .75em; font-weight: 700; text-transform: uppercase; }
.pc-abo-gratuit { background: var(--pc-gray-200); color: var(--pc-gray-700); }
.pc-abo-starter { background: #dbeafe; color: #1d4ed8; }
.pc-abo-pro { background: #e9d5ff; color: #7c3aed; }
.pc-abo-unlimited { background: #fef3c7; color: #d97706; }

/* MAP */
.pc-map-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; padding: 0 15px; }
.pc-map-controls select { padding: 8px 12px; border: 2px solid var(--pc-gray-200); border-radius: 8px; font-size: .9em; }
#pc-map { height: 350px; border-radius: var(--pc-radius); overflow: hidden; box-shadow: var(--pc-shadow); margin: 0 15px 20px; }

/* PRINTERS LIST */
.pc-printers-list { padding: 0 15px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-bottom: 20px; }
.pc-printer-card { background: #fff; border: 1px solid var(--pc-gray-200); border-radius: var(--pc-radius); padding: 15px; box-shadow: var(--pc-shadow); cursor: pointer; transition: all .2s; }
.pc-printer-card:hover { box-shadow: var(--pc-shadow-lg); transform: translateY(-2px); }
.pc-printer-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.pc-printer-name { font-weight: 700; font-size: 1em; }
.pc-printer-distance { font-size: .8em; color: var(--pc-gray-400); }
.pc-printer-address { font-size: .85em; color: var(--pc-gray-400); margin-bottom: 8px; }
.pc-printer-services { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-service-tag { padding: 2px 8px; border-radius: 20px; font-size: .75em; font-weight: 600; background: var(--pc-primary-light); color: var(--pc-primary); }
.pc-printer-footer { display: flex; justify-content: space-between; align-items: center; }
.pc-online-dot { display: inline-flex; align-items: center; gap: 5px; font-size: .8em; }
.pc-online-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pc-gray-400); }
.pc-online-dot.online::before { background: var(--pc-success); }
.pc-printer-note { font-size: .85em; color: var(--pc-warning); }

/* ORDERS LIST */
.pc-orders-list { padding: 0 15px; }
.pc-order-card { background: #fff; border: 1px solid var(--pc-gray-200); border-radius: var(--pc-radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--pc-shadow); }
.pc-order-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.pc-order-code { font-weight: 700; font-size: .95em; color: var(--pc-primary); }
.pc-order-date { font-size: .8em; color: var(--pc-gray-400); }
.pc-order-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pc-order-detail { font-size: .85em; }
.pc-order-detail span { display: block; color: var(--pc-gray-400); font-size: .85em; }
.pc-order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-order-actions button { flex: 1; min-width: 100px; }

/* STATUS BADGES */
.pc-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78em; font-weight: 700; }
.pc-status-en_attente_paiement { background: #fef3c7; color: #92400e; }
.pc-status-payee { background: #dbeafe; color: #1e40af; }
.pc-status-acceptee { background: #e0e7ff; color: #3730a3; }
.pc-status-en_cours { background: #ede9fe; color: #5b21b6; }
.pc-status-prete { background: #d1fae5; color: #065f46; }
.pc-status-recuperee { background: #d1fae5; color: #065f46; }
.pc-status-annulee { background: #fee2e2; color: #991b1b; }

/* UPLOAD */
.pc-upload-zone { border: 2px dashed var(--pc-gray-200); border-radius: 8px; padding: 25px; text-align: center; cursor: pointer; transition: all .15s; }
.pc-upload-zone:hover { border-color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-upload-zone.uploaded { border-color: var(--pc-success); background: #ecfdf5; }
.pc-progress { background: var(--pc-gray-200); border-radius: 4px; height: 6px; margin-top: 10px; }
.pc-progress-bar { background: var(--pc-primary); height: 100%; border-radius: 4px; transition: width .3s; }

/* PRICE SUMMARY */
.pc-price-summary { background: var(--pc-gray-50); border-radius: 8px; padding: 15px; margin: 15px 0; }
.pc-price-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: .9em; }
.pc-price-total { border-top: 1px solid var(--pc-gray-200); margin-top: 5px; padding-top: 10px; font-size: 1.05em; }

/* RADIO CARDS */
.pc-radio-group { display: flex; gap: 10px; }
.pc-radio-card { flex: 1; border: 2px solid var(--pc-gray-200); border-radius: 8px; padding: 12px; cursor: pointer; transition: all .15s; }
.pc-radio-card:has(input:checked) { border-color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-radio-card input { display: none; }

/* MODAL */
.pc-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pc-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.pc-modal-content { position: relative; background: #fff; border-radius: var(--pc-radius); box-shadow: var(--pc-shadow-lg); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 30px; animation: pc-modal-in .2s ease; }
.pc-modal-small { max-width: 400px; }
.pc-modal-chat { max-width: 560px; display: flex; flex-direction: column; }
@keyframes pc-modal-in { from { opacity:0; transform: translateY(-20px); } to { opacity:1; transform: translateY(0); } }
.pc-modal-close { position: absolute; top: 15px; right: 15px; width: 30px; height: 30px; border: none; background: var(--pc-gray-100); border-radius: 50%; cursor: pointer; font-size: 1em; display: flex; align-items: center; justify-content: center; }

/* PRINTER INFO (in modal) */
.pc-printer-info { background: var(--pc-gray-50); border-radius: 8px; padding: 12px; margin-bottom: 15px; font-size: .9em; }

/* STRIPE */
.pc-stripe-input { border: 2px solid var(--pc-gray-200); border-radius: 8px; padding: 12px; min-height: 42px; margin: 15px 0; }
.pc-secure-note { text-align: center; color: var(--pc-gray-400); font-size: .8em; margin-top: 10px; }

/* ORDER SUMMARY */
.pc-order-summary { background: var(--pc-gray-50); border-radius: 8px; padding: 15px; margin-bottom: 20px; }

/* SUCCESS SCREEN */
.pc-success-screen { text-align: center; padding: 20px; }
.pc-success-icon { font-size: 4em; display: block; margin-bottom: 15px; }

/* CHAT */
.pc-modal-chat .pc-modal-content { height: 90vh; }
.pc-chat-header { border-bottom: 1px solid var(--pc-gray-200); padding-bottom: 12px; margin-bottom: 15px; }
.pc-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 200px; max-height: 400px; padding: 5px 0; }
.pc-message { max-width: 75%; }
.pc-message-mine { align-self: flex-end; }
.pc-message-other { align-self: flex-start; }
.pc-message-bubble { padding: 10px 14px; border-radius: 18px; font-size: .9em; line-height: 1.4; }
.pc-message-mine .pc-message-bubble { background: var(--pc-primary); color: #fff; border-bottom-right-radius: 4px; }
.pc-message-other .pc-message-bubble { background: var(--pc-gray-100); color: var(--pc-gray-900); border-bottom-left-radius: 4px; }
.pc-message-time { font-size: .72em; color: var(--pc-gray-400); margin-top: 3px; text-align: right; }
.pc-chat-input { display: flex; gap: 8px; margin-top: 12px; border-top: 1px solid var(--pc-gray-200); padding-top: 12px; }
.pc-chat-input input { flex: 1; padding: 10px 14px; border: 2px solid var(--pc-gray-200); border-radius: 8px; font-size: .95em; outline: none; }
.pc-chat-input input:focus { border-color: var(--pc-primary); }

/* PLANS */
.pc-plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
.pc-plan-card { border: 2px solid var(--pc-gray-200); border-radius: var(--pc-radius); padding: 20px; text-align: center; }
.pc-plan-card.pc-plan-current { border-color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-plan-price { font-size: 2em; font-weight: 800; color: var(--pc-primary); }
.pc-plan-price span { font-size: .4em; font-weight: 400; }
.pc-plan-features { list-style: none; padding: 0; margin: 10px 0 15px; text-align: left; font-size: .85em; }
.pc-plan-features li::before { content: '✓ '; color: var(--pc-success); font-weight: 700; }

/* TOGGLE (printer online) */
.pc-toggle { position: relative; display: inline-block; width: 46px; height: 24px; }
.pc-toggle input { display: none; }
.pc-toggle-slider { position: absolute; inset: 0; background: var(--pc-gray-200); border-radius: 24px; cursor: pointer; transition: .3s; }
.pc-toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.pc-toggle input:checked + .pc-toggle-slider { background: var(--pc-success); }
.pc-toggle input:checked + .pc-toggle-slider::before { transform: translateX(22px); }

/* STATS ROW */
.pc-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 0 15px; }
.pc-stat-box { background: #fff; border: 1px solid var(--pc-gray-200); border-radius: var(--pc-radius); padding: 18px; text-align: center; box-shadow: var(--pc-shadow); }
.pc-stat-box-value { font-size: 1.8em; font-weight: 800; color: var(--pc-primary); }
.pc-stat-box-label { font-size: .8em; color: var(--pc-gray-400); margin-top: 4px; }

/* SECTION HEADER */
.pc-section-header { display: flex; justify-content: space-between; align-items: center; padding: 0 15px; margin-bottom: 12px; }
.pc-section-header h3 { margin: 0; }

/* STARS */
.pc-stars { display: flex; justify-content: center; gap: 8px; font-size: 2.5em; cursor: pointer; }
.pc-stars span { color: var(--pc-gray-200); transition: color .1s; }
.pc-stars span.active { color: var(--pc-warning); }

/* TOAST */
.pc-toast { position: fixed; bottom: 30px; right: 30px; background: var(--pc-gray-900); color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 99999; font-size: .9em; box-shadow: var(--pc-shadow-lg); animation: pc-toast-in .2s ease; max-width: 350px; }
.pc-toast.pc-toast-success { background: var(--pc-success); }
.pc-toast.pc-toast-error { background: var(--pc-danger); }
@keyframes pc-toast-in { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* EMPTY STATE */
.pc-empty { text-align: center; padding: 40px; color: var(--pc-gray-400); }

/* CGU */
.pc-cgu-content { max-height: 60vh; overflow-y: auto; padding: 10px; font-size: .9em; line-height: 1.6; }
.pc-modal-cgu { max-width: 700px; }

/* SUB DESC */
.pc-sub-desc { padding: 0 15px; color: var(--pc-gray-400); margin-bottom: 5px; }

/* TABLET/DESKTOP */
@media (min-width: 768px) {
    .pc-hero h1 { font-size: 3em; }
    .pc-dashboard-header { display: flex; justify-content: space-between; align-items: center; }
    .pc-dashboard-title { margin-bottom: 0; }
    #pc-map { height: 420px; }
}

@media (max-width: 480px) {
    .pc-hero { padding: 40px 20px; }
    .pc-hero h1 { font-size: 1.8em; }
    .pc-form-row { grid-template-columns: 1fr; }
    .pc-otp-input { width: 40px; height: 48px; font-size: 1.3em; }
    .pc-auth-card { padding: 20px; }
    .pc-modal-content { padding: 20px; }
}

/* ADMIN (inline dans WP) */
.pc-admin .pc-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin: 20px 0; }
.pc-admin .pc-stat-card { background: #fff; border-radius: 10px; padding: 20px; text-align: center; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pc-admin .pc-stat-value { font-size: 1.8em; font-weight: 800; }
.pc-admin .pc-stat-label { font-size: .8em; color: #888; margin-top: 5px; }
.pc-admin .pc-purple .pc-stat-value { color: #7c3aed; }
.pc-admin .pc-blue .pc-stat-value { color: #2563eb; }
.pc-admin .pc-green .pc-stat-value { color: #059669; }
.pc-admin .pc-orange .pc-stat-value { color: #d97706; }
.pc-admin .pc-teal .pc-stat-value { color: #0d9488; }
.pc-admin .pc-indigo .pc-stat-value { color: #4f46e5; }
.pc-admin .pc-card { background: #fff; border-radius: 10px; padding: 20px; margin: 20px 0; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pc-admin .pc-table { border-radius: 8px; overflow: hidden; }
.pc-admin .pc-alert { padding: 12px 18px; border-radius: 8px; margin: 15px 0; }
.pc-admin .pc-alert-warning { background: #fef9c3; border-left: 4px solid #facc15; }
.pc-admin .pc-alert-info { background: #eff6ff; border-left: 4px solid #3b82f6; }
.pc-admin .pc-alert-info code { background: #dbeafe; padding: 2px 6px; border-radius: 4px; }
.pc-admin .pc-badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: .78em; font-weight: 600; background: #f3f4f6; }
.pc-admin .pc-badge-success { background: #d1fae5; color: #065f46; }
.pc-admin .pc-badge-warning { background: #fef3c7; color: #92400e; }
.pc-admin .pc-badge-danger { background: #fee2e2; color: #991b1b; }
.pc-admin .pc-badge-primary { background: #e0e7ff; color: #3730a3; }
.pc-admin .pc-badge-info { background: #dbeafe; color: #1e40af; }
.pc-admin .pc-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 15px; }
