/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --accent-color: #f39c12;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --error-color: #e74c3c;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

/* Bouton de changement de langue */
.lang-toggle {
    position: absolute;
    top: 25px;
    right: 40px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #2ecc71;
    background-color: #ffffff;
    color: #2ecc71;
    font-size: 0.85rem;
    font-family: "Roboto", Arial, sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    /* z-index: 60; */
}

.lang-toggle span {
    font-weight: 500;
}

.lang-toggle:hover {
    background-color: #2ecc71;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(12, 33, 142, 0.25);
    transform: translateY(-1px);
}

.lang-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(12, 33, 142, 0.2);
}

.logo {
    animation: bounce 2s infinite;
}

.logo img{
    width: 450px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 300;
}

/* Form sections */
form {
    padding: 40px 30px;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

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

.section h2 {
    color: var(--primary-color);
    font-size: 26px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

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

::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Product cards */
#products-container {
    margin-bottom: 25px;
}

.product-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.product-header h3 {
    color: var(--secondary-color);
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-remove-product {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-remove-product:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.product-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

/* Subsections */
.subsection {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.subsection h4 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Intrants section */
.intrants-section {
    margin-top: 25px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 10px;
    border: 2px dashed var(--primary-color);
}

.intrants-section h4 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.intrant-group {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.intrant-label {
    display: block;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 12px;
}

.intrant-items {
    margin-bottom: 10px;
}

.intrant-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 40px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.intrant-item input {
    padding: 10px;
    font-size: 13px;
}

/* Buttons */
.btn-add-product {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-add-product:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-add-mini {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add-mini:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-remove-mini {
    background: var(--error-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-mini:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background: var(--accent-color);
    color: white;
    animation: pulse 2s infinite;
}

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

.btn-success:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Progress dots */
.progress-dots {
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.dot:hover {
    transform: scale(1.2);
}

/* Footer */
.footer {
    background: var(--bg-light);
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Success message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    animation: slideInRight 0.5s ease;
    z-index: 1000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .logo img {
        width: 250px;
    }
    .lang-toggle{
        top: 15px;
        right: 10px;
    }

    form {
        padding: 25px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .section h2 {
        font-size: 22px;
    }

    .product-card {
        padding: 20px;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .intrant-item {
        grid-template-columns: 1fr;
    }

    .intrant-item input {
        width: 100%;
    }

    .btn-remove-mini {
        width: 100%;
        height: auto;
        padding: 10px;
    }

    .navigation {
        flex-wrap: wrap;
        gap: 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .progress-dots {
        width: 100%;
        justify-content: center;
        order: -1;
    }
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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