/* exemplaire_form.css */
.page-wrapper-scrollable {
    display: block;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 20px 40px;
}

.form-container {
    max-width: 98%;
    margin: 0 auto;
}

.form-section-card {
    background: rgba(31, 34, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--accent-blue, #007aff);
    font-size: 1.25em;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 25px;
}

.form-grid-3cols {
    grid-template-columns: repeat(3, minmax(300px, 1fr)) !important;
}

@media (max-width: 1024px) {
    .form-grid-3cols {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    }
}

.form-grid.inline-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.form-grid.inline-row .form-group {
    flex: 1;
    min-width: 0;
}

input[type="number"],
.form-group input,
.form-group select {
    color-scheme: dark;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.8em;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-size: 0.95em;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-group textarea {
    height: 100px;
    padding: 14px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007aff;
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    outline: none;
}

.col-2 { grid-column: span 2; }
.col-full { grid-column: 1 / -1; }

.submit-bar {
    position: sticky;
    bottom: 0;
    background: rgba(28, 30, 39, 0.9);
    backdrop-filter: blur(15px);
    margin: 0 -40px;
    padding: 20px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.btn {
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 1em;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007aff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.current-image-preview {
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.current-image-preview img {
    max-height: 100px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.delete-check-label {
    color: #ff453a;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.image-option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 15px;
}

.image-option-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-blue);
}

.image-option-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.image-option-card .info { flex: 1; }
.image-option-card .title { font-weight: 600; font-size: 0.9em; color: #fff; margin-bottom: 4px; }
.image-option-card .subtitle { font-size: 0.75em; color: #94a3b8; }

#selected-existing-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid var(--accent-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

#selected-existing-preview img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.btn-action-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    height: 40px;
}

.btn-action-view:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.btn-action-view.primary {
    background: rgba(52, 199, 89, 0.15);
    border-color: rgba(52, 199, 89, 0.3);
    color: #4ade80;
}

.btn-action-view.primary:hover {
    background: rgba(52, 199, 89, 0.25);
    border-color: #4ade80;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(52, 199, 89, 0.2);
}

.yt-badge-container {
    width: 138px;
    height: 151px;
    flex-shrink: 0;
    margin-left: 15px;
}

.yt-hex-badge {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%),
                linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(0, 122, 255, 0.05) 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(0, 122, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 25px rgba(0, 122, 255, 0.25), inset 0 2px 5px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.yt-hex-badge.hex-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.yt-hex-badge.hex-secondary .yt-label { color: #aaa; }

.yt-hex-badge .yt-label {
    font-size: 1.25em;
    text-transform: uppercase;
    color: var(--accent-blue, #0a84ff);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 2px;
}

.yt-hex-badge .yt-number {
    font-size: 1.6em;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-top: 5px;
}

/* --- STYLES DU TABLEAU DE SAISIE (RESTORED) --- */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-scroll-container table {
    border-spacing: 0;
}

.table-scroll-container th {
    background: rgba(15, 23, 42, 0.5);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-scroll-container input,
.table-scroll-container select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
    padding: 8px;
    color: white !important;
    font-size: 0.9em;
    transition: all 0.2s;
}

.table-scroll-container input:focus {
    border-color: var(--accent-blue) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    outline: none;
}

.matrix-qty {
    text-align: center;
    font-weight: 800;
    color: #fff !important;
    font-size: 1.1em !important;
}

.cote-input-direct {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 600;
}

.pv-input {
    border-color: rgba(255, 159, 10, 0.3) !important;
}

.expert-fields {
    background: #1e293b !important;
    border: 1px solid #ff9f0a !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Suppression des flèches sur les inputs number pour le look Premium */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* State Pills */
.state-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.state-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 18px;
    color: #94a3b8;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.state-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateY(-1px);
}

.state-pill.active {
    background: var(--pill-color);
    border-color: var(--pill-color);
    color: #fff;
    box-shadow: 0 0 15px var(--pill-shadow);
    transform: scale(1.03);
}

/* Accordion / Collapsible section */
.collapsible-card {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.collapsible-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.collapsible-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.01);
}

.collapsible-header h4 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapsible-icon {
    font-size: 0.8em;
    color: #94a3b8;
    transition: transform 0.3s;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    padding: 0 20px;
}

.collapsible-card.active .collapsible-content {
    max-height: 1200px;
    padding: 15px 20px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.collapsible-card.active .collapsible-icon {
    transform: rotate(180deg);
}

/* Stepper input */
.stepper-container {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    height: 48px;
    width: 100%;
    overflow: hidden;
}

.stepper-btn {
    width: 48px;
    height: 100%;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.stepper-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.stepper-input {
    flex: 1;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    text-align: center;
    font-weight: 800;
    font-size: 1.1em !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Toggle switches */
.toggle-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0 15px;
}

.toggle-switch-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #cbd5e1;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: #94a3b8;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #34c759;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: #fff;
}

.localisation-highlight {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.15) !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
