/* =============================================
   DALLE EXPERT CRM — STYLESHEET
   ============================================= */

:root {
    --primary: #1a2e4a;
    --primary-light: #243d61;
    --accent: #f97316;
    --accent-hover: #ea6c0a;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --bg: #f4f6fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- HEADER ---- */
.site-header {
    background: var(--primary);
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.logo-text strong { font-weight: 700; color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .site-header { justify-content: space-between; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 24px 0;
    margin-top: 60px;
    font-size: 13px;
}

/* ---- ALERTS ---- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- FORM CARD ---- */
.main-content { padding: 40px 0 60px; }

.form-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 36px 40px;
    color: #fff;
}

.form-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-header p { opacity: 0.8; font-size: 15px; }

/* ---- FORM SECTIONS ---- */
.form-section {
    padding: 32px 40px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; }

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.section-num {
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.required { color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

textarea { resize: vertical; min-height: 100px; }

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

/* ---- RADIO CARDS ---- */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
    background: #fff;
    color: var(--text);
}

.radio-card:has(input:checked),
.radio-card input:checked + span { color: var(--accent); }

.radio-card:has(input:checked) {
    border-color: var(--accent);
    background: #fff7ed;
}

.radio-card input { margin: 0; accent-color: var(--accent); }

.toggle-group {
    display: flex;
    gap: 12px;
}

.toggle-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
    background: #fff;
    color: var(--text);
}

.toggle-card:has(input:checked) {
    border-color: var(--accent);
    background: #fff7ed;
    color: var(--accent);
}

.toggle-card input { display: none; }

.radio-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-card-horizontal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: normal;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
    background: #fff;
    color: var(--text);
}

.radio-card-horizontal:has(input:checked) {
    border-color: var(--accent);
    background: #fff7ed;
}

.radio-card-horizontal input { accent-color: var(--accent); flex-shrink: 0; }
.radio-card-horizontal div { display: flex; align-items: center; gap: 10px; flex: 1; }
.radio-card-horizontal strong { font-weight: 600; }

.price-tag {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* ---- CONDITIONAL ---- */
.conditional-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

/* ---- FILE UPLOAD ---- */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    position: relative;
}

.file-upload-area:hover, .file-upload-area.drag-over {
    border-color: var(--accent);
    background: #fff7ed;
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-text { pointer-events: none; }
.file-icon { font-size: 32px; }
.file-upload-text p { margin: 8px 0 4px; font-size: 15px; color: var(--text-muted); }
.file-upload-text small { font-size: 12px; color: var(--text-muted); }
.file-upload-text strong { color: var(--accent); }

.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
}

.file-size { color: var(--text-muted); font-size: 12px; }

/* ---- SUBMIT BUTTON ---- */
.form-submit {
    padding: 32px 40px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

.btn-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 16px 48px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249,115,22,0.45);
}

.btn-submit:active { transform: translateY(0); }

.submit-note {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: normal;
    letter-spacing: 0;
    text-transform: none;
}

/* =============================================
   ADMIN PANEL
   ============================================= */

.admin-page { background: var(--bg); min-height: 100vh; }

.admin-header {
    background: var(--primary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .logo { text-decoration: none; }

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 18px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #2c4a7a 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    margin-bottom: 28px;
}

.login-logo .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
    margin: 0 auto 12px;
}

.login-logo .logo-text { font-size: 24px; justify-content: center; color: var(--primary); }

.login-card h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.login-group { text-align: left; margin-bottom: 20px; }

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary:hover { background: var(--accent-hover); }

/* ---- ADMIN DASHBOARD ---- */
.admin-main { padding: 32px 0 60px; }

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title h1 { font-size: 24px; font-weight: 700; color: var(--text); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-num { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-card.accent .stat-num { color: var(--accent); }
.stat-card.success .stat-num { color: var(--success); }
.stat-card.warning .stat-num { color: var(--warning); }

/* ---- TABLE ---- */
.table-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h2 { font-size: 16px; font-weight: 700; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
    background: #f8fafc;
    padding: 12px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-nouveau   { background: #dbeafe; color: #1d4ed8; }
.badge-traité    { background: #dcfce7; color: #15803d; }
.badge-en-attente { background: #fef3c7; color: #92400e; }

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-view { background: var(--primary); color: #fff; }
.btn-view:hover { background: var(--primary-light); }
.btn-send { background: var(--success); color: #fff; }
.btn-send:hover { background: #15803d; }
.btn-send:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-back { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-back:hover { background: var(--border); }

/* ---- SUBMISSION DETAIL ---- */
.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color: #fff;
}

.detail-card-header h2 { font-size: 16px; font-weight: 700; }

.detail-card-body { padding: 24px; }

.detail-section { margin-bottom: 28px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.detail-value { font-weight: 600; text-align: right; word-break: break-word; }

.sidebar-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
}

.sidebar-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.btn-send-large {
    display: block;
    width: 100%;
    background: var(--success);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-align: center;
    margin-bottom: 10px;
}

.btn-send-large:hover { background: #15803d; }
.btn-send-large:disabled { background: #9ca3af; cursor: not-allowed; }

.sent-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.client-info-sidebar p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text);
}

.client-info-sidebar a { color: var(--accent); text-decoration: none; }
.client-info-sidebar a:hover { text-decoration: underline; }

/* Google Maps autocomplete dropdown */
.pac-container {
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
}

.pac-item { padding: 8px 14px; font-size: 14px; }
.pac-item:hover { background: #fff7ed; }
.pac-matched { color: var(--accent); font-weight: 600; }

/* ---- SPINNER ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ---- SUCCESS PAGE ---- */
.success-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 480px;
}

.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: var(--success); }
.success-card p { color: var(--text-muted); margin-bottom: 28px; }
.btn-home { display: inline-block; background: var(--accent); color: #fff; padding: 12px 32px; border-radius: 8px; text-decoration: none; font-weight: 700; }

/* ---- PAGINATION / FILTER ---- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select, .filter-bar input {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    width: auto;
}

.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

@media (max-width: 600px) {
    .form-section { padding: 24px 20px; }
    .form-header { padding: 28px 20px; }
    .form-submit { padding: 24px 20px; }
    .radio-grid { grid-template-columns: 1fr 1fr; }
    .toggle-group { flex-direction: column; }
}
