/* ================================================================ */
/* === CSS MODERNE POUR OFFRE DE DÉSTOCKAGE ====================== */
/* === Inspire de l'ADN consultation-appeloffre.html ============= */
/* ================================================================ */

/* Import des variables centralisées */
@import url('variables.css');

/* === CONTAINER PRINCIPAL ======================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3rem;
    background: transparent;
}

/* === BARRE D'ACTION ============================================ */
.action-buttons-bar {
    background: var(--bg-card);
    padding: 1rem 3rem;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-wine), var(--accent-copper));
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
}

.btn-action:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-action .badge {
    background: white;
    color: var(--accent-wine);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* === BARRE DE PROGRESSION MODERNE ============================== */
.progress-container {
    margin-bottom: 3rem;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-wine), var(--accent-copper), var(--accent-gold));
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 1rem;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-light);
    z-index: 0;
    border-radius: 4px;
}

.progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-wine), var(--accent-copper));
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(124, 10, 41, 0.3);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 150px;
}

.step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-tertiary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.3;
    transition: all 0.3s ease;
    max-width: 100px;
}

.step.active .step-circle {
    background: linear-gradient(135deg, var(--accent-wine), var(--accent-copper));
    border-color: var(--accent-wine);
    color: white;
    box-shadow: var(--shadow-lg), 0 0 15px rgba(124, 10, 41, 0.4);
    transform: scale(1.15);
}

.step.active .step-label {
    color: var(--accent-wine);
    font-weight: 700;
}

.step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: var(--shadow-md);
}

.step.completed .step-circle::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.step.completed .step-label {
    color: var(--success);
}

/* === SECTIONS FORMULAIRE ======================================= */
.form-section {
    display: none;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
}

.form-section.active {
    display: block;
}

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

/* === TITRES DE SECTIONS ======================================== */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.section-title i {
    color: var(--accent-wine);
    font-size: 1.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* === GRILLE FORMULAIRE ========================================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* === GROUPES DE FORMULAIRE ===================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

/* === LABELS ==================================================== */
.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.required {
    color: var(--warning);
    font-weight: 700;
}

/* === INPUTS & SELECTS ========================================== */
.form-input,
.form-select,
.form-textarea,
.autocomplete-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.autocomplete-input:focus {
    border-color: var(--accent-wine);
    box-shadow: 0 0 0 4px rgba(124, 10, 41, 0.1);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.autocomplete-input:hover {
    border-color: var(--accent-copper);
}

.form-input:disabled,
.form-select:disabled {
    background: var(--bg-main);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* === HINTS & HELP TEXT ========================================= */
.input-hint,
.help-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: 0.25rem;
}

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

/* === PRIX INPUT ================================================ */
.price-input-wrapper {
    position: relative;
}

.price-input-wrapper .form-input {
    padding-right: 3rem;
}

.price-symbol {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* === BADGE REMISE ============================================== */
.discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* === CÉPAGES =================================================== */
.cepage-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cepage-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.cepage-item:hover {
    border-color: var(--accent-copper);
    box-shadow: var(--shadow-sm);
}

.cepage-percentage-input {
    width: 100px;
}

.btn-remove {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--warning);
    color: var(--warning);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-remove:hover {
    background: var(--warning);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-add {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 2px dashed var(--accent-wine);
    color: var(--accent-wine);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add:hover {
    background: var(--accent-wine);
    color: white;
    border-color: var(--accent-wine);
    box-shadow: var(--shadow-md);
}

/* === FORMATS GRID ============================================== */
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.format-card {
    position: relative;
    border: 2px solid var(--border-medium);
    border-radius: 12px;
    padding: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.format-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.format-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    text-align: center;
}

.format-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.format-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.format-card:hover {
    border-color: var(--accent-wine);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.format-card input[type="checkbox"]:checked + label .format-name {
    color: var(--accent-wine);
}

.format-card:has(input[type="checkbox"]:checked) {
    background: rgba(124, 10, 41, 0.05);
    border-color: var(--accent-wine);
    border-width: 3px;
    box-shadow: var(--shadow-lg);
}

.format-card:has(input[type="checkbox"]:checked)::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-wine);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.format-section {
    padding: 1.5rem;
    background: var(--bg-main);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.format-section .form-label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* === UPLOAD ZONE =============================================== */
.file-upload-container {
    border: 3px dashed var(--border-medium);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-main);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-container:hover {
    border-color: var(--accent-wine);
    background: rgba(124, 10, 41, 0.02);
}

.file-upload-container.dragover {
    border-color: var(--accent-wine);
    background: rgba(124, 10, 41, 0.08);
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--accent-wine);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.image-preview-container {
    margin-top: 1.5rem;
    text-align: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--border-light);
}

/* === BOUTONS D'ACTION ========================================== */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-light);
}

.btn {
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-wine), var(--accent-copper));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-main);
    border-color: var(--accent-wine);
    color: var(--accent-wine);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === CHECKBOX & RADIO ========================================== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    border-color: var(--accent-wine);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

/* === AUTOCOMPLETE ============================================== */
.autocomplete-container {
    position: relative;
}

.autocomplete-input {
    width: 100%;
}

.form-select[size] {
    border-radius: 10px;
    max-height: 200px;
    background: white;
    border: 2px solid var(--accent-wine);
    box-shadow: var(--shadow-md);
}

.form-select[size] option {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.form-select[size] option:hover,
.form-select[size] option:focus {
    background: rgba(124, 10, 41, 0.1);
}

/* === RESPONSIVE ================================================ */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .action-buttons-bar {
        padding: 1rem 1.5rem;
    }

    .progress-container {
        padding: 2rem 1rem 1.5rem;
    }

    .step-label {
        font-size: 0.65rem;
        max-width: 80px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .formats-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* === ANIMATIONS & MICRO-INTERACTIONS =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-input:not(:placeholder-shown):valid {
    border-color: var(--success);
}

.form-input:not(:placeholder-shown):invalid {
    border-color: var(--warning);
}

/* === AMÉLIORATION VISUELLE DES SELECTS ========================= */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C0A29' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 3rem;
}

/* === LOADING STATE ============================================= */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--border-light);
    border-top-color: var(--accent-wine);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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