/* ========================================
   STYLE.CSS - Module Maintenance
   Mobile-first responsive design
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Typography */
h1 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 8px;
    text-align: center;
    touch-action: manipulation;
}

.subtitle {
    color: #718096;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
    touch-action: manipulation;
}

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

label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
    touch-action: manipulation;
}

label .required {
    color: #e53e3e;
}

/* FIX: Uniformiser tous les inputs (text, tel, etc.) */
input[type="text"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* Force la même hauteur pour tous les inputs */
    min-height: 48px;
    line-height: 1.5;
}

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

input:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Categories Grid */
.categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
    transition: opacity 0.3s, transform 0.3s;
}

.categories.hidden {
    display: none;
}

.category-btn {
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.category-btn:active {
    transform: scale(0.95);
}

.category-btn .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    pointer-events: none;
}

.category-btn .label {
    font-weight: 700;
    font-size: 14px;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Hover uniquement sur desktop */
@media (hover: hover) and (pointer: fine) {
    .category-btn:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
}

/* Description Section */
#descriptionSection {
    display: none;
    animation: slideIn 0.4s ease-out;
}

#descriptionSection.visible {
    display: block;
}

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

/* Selected Category Badge */
.selected-category {
    background: #f7fafc;
    border: 3px solid currentColor;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    touch-action: manipulation;
}

.selected-category .icon {
    font-size: 32px;
    pointer-events: none;
}

.selected-category .text {
    flex: 1;
    pointer-events: none;
}

.selected-category .category-name {
    font-weight: 700;
    font-size: 16px;
    color: #2d3748;
    text-transform: uppercase;
    pointer-events: none;
}

.selected-category .change-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.selected-category .change-btn:active {
    opacity: 0.7;
}

.helper-text {
    font-size: 13px;
    color: #718096;
    margin-top: 6px;
    font-style: italic;
    touch-action: manipulation;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.submit-btn:active {
    transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    }
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Confirmation Screen */
#confirmationScreen {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

#confirmationScreen .icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

#confirmationScreen h2 {
    color: #48bb78;
    font-size: 24px;
    margin-bottom: 10px;
}

#confirmationScreen p {
    color: #718096;
    font-size: 16px;
    line-height: 1.6;
}

/* Error Messages */
.error {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.error.visible {
    display: block;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none;
}
