/* ============================================
   SERVICAM - INSCRIPTION PROFESSIONNEL CSS
   ============================================ */

/* Variables */
:root {
    --primary-color: #4F46E5;
    --primary-light: rgba(79, 70, 229, 0.1);
    --primary-dark: #004494;
    --success-color: #25D366;
    --error-color: #F44336;
    --warning-color: #FF9800;
    --gray-light: #f5f5f5;
    --gray-medium: #888;
    --gray-dark: #333;
    --white: #fff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* Main Container */
.inscription-main {
    padding: 20px 0 60px;
    min-height: calc(100vh - 160px);
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4fd 100%);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    width: 20%;
    transition: width 0.4s ease;
    border-radius: 3px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-steps .step {
    font-size: 12px;
    color: var(--gray-medium);
    padding: 6px 12px;
    background: var(--white);
    border-radius: 20px;
    transition: var(--transition);
}

.progress-steps .step.active {
    color: var(--white);
    background: var(--primary-color);
    font-weight: 600;
}

.progress-steps .step.completed {
    color: var(--success-color);
    background: rgba(37, 211, 102, 0.1);
}

/* Form */
.inscription-form {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .inscription-form {
        padding: 24px 16px;
        border-radius: 0;
        margin: 0 -15px;
    }
}

/* Form Section */
.form-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.section-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

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

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

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

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

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-medium);
}

.field-error { color: #e53935; font-size: 12px; margin-top: 5px; display: block; font-weight: 500; }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

input.readonly-input {
    background: var(--gray-light);
    cursor: not-allowed;
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' 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 12px center;
    background-size: 18px;
    padding-right: 40px;
}

select:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
}

/* Photo Upload */
.photo-upload {
    display: flex;
    align-items: center;
    gap: 24px;
}

.photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    background: var(--gray-light);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload {
    padding: 12px 20px;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

/* Réalisations Upload */
.realisations-upload {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.realisations-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.realisation-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-light);
}

.realisation-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.realisation-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.realisation-item:hover .remove-btn {
    opacity: 1;
}

.btn-upload-realisations {
    padding: 16px 24px;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

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

/* Social Inputs */
.social-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-icon {
    font-size: 20px;
    width: 40px;
    text-align: center;
}

.social-input input {
    flex: 1;
}

/* GPS Section */
.gps-section {
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--radius);
}

.gps-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.btn-gps {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

.btn-gps.loading {
    opacity: 0.7;
    cursor: wait;
}

.gps-coords {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--gray-medium);
}

.gps-coords strong {
    color: var(--primary-color);
}

/* Tags Input */
.tags-input-container {
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    transition: var(--transition);
}

.tags-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tag-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.tag-remove:hover {
    opacity: 1;
}

.tags-input-container input {
    flex: 1;
    min-width: 150px;
    border: none;
    padding: 6px;
    font-size: 14px;
}

.tags-input-container input:focus {
    outline: none;
    box-shadow: none;
}

/* Horaires Grid */
.horaires-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.horaire-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.horaire-row .jour {
    min-width: 90px;
    font-weight: 500;
    color: var(--gray-dark);
}

.horaire-row input {
    flex: 1;
    max-width: 200px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle {
    position: relative;
    width: 56px;
    height: 30px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-medium);
    border-radius: 30px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--success-color);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 500;
    color: var(--gray-dark);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-container input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-container a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-light);
}

.btn-prev,
.btn-next,
.btn-submit {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-prev {
    background: var(--gray-light);
    color: var(--gray-dark);
}

.btn-prev:hover {
    background: #e0e0e0;
}

.btn-next {
    background: var(--primary-color);
    color: var(--white);
    margin-left: auto;
}

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

.btn-submit {
    background: var(--success-color);
    color: var(--white);
    margin-left: auto;
}

.btn-submit:hover {
    background: #20b85a;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 60px 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease;
}

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

.success-message h2 {
    color: var(--success-color);
    margin-bottom: 16px;
}

.success-message p {
    color: var(--gray-medium);
    margin-bottom: 12px;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.success-actions a {
    text-decoration: none !important;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

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

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--gray-dark);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 18px 28px;
    background: #333;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #4F46E5;
}

/* Simple Footer */
.footer-simple {
    background: var(--gray-dark);
    color: var(--white);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .progress-steps {
        justify-content: center;
    }
    
    .progress-steps .step {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .photo-upload {
        flex-direction: column;
        text-align: center;
    }
    
    .gps-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gps-coords {
        flex-direction: column;
        gap: 8px;
    }
    
    .horaire-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .horaire-row input {
        max-width: 100%;
    }
    
    .form-navigation {
        flex-direction: column;
    }
    
    .btn-next,
    .btn-submit {
        margin-left: 0;
    }
}

/* ============================================
   MAP STYLES
   ============================================ */
.map-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

#locationMap {
    width: 100% !important;
    min-height: 400px;
    height: 450px;
    z-index: 1;
}

@media (max-width: 768px) {
    #locationMap {
        min-height: 350px;
        height: 380px;
    }
    
    .map-container {
        margin-top: 15px;
    }
    
    .map-notice {
        font-size: 13px;
        padding: 10px 14px !important;
    }
}

.custom-marker {
    background: none !important;
    border: none !important;
}

.btn-gps {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-gps svg {
    flex-shrink: 0;
}

.btn-gps svg.spin {
    animation: spin 1s linear infinite;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(79, 70, 229, 0.5); }
}

.leaflet-container {
    font-family: inherit;
}

.gps-section .help-text svg {
    vertical-align: middle;
}

/* ============================================
   INSCRIPTIONS FERMÉES MESSAGE
   ============================================ */
.inscriptions-closed-message {
    max-width: 500px;
    margin: 60px auto;
    text-align: center;
    padding: 60px 40px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.inscriptions-closed-message .closed-icon {
    width: 100px;
    height: 100px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #F44336;
}

.inscriptions-closed-message h2 {
    font-size: 24px;
    color: var(--gray-dark);
    margin-bottom: 16px;
}

.inscriptions-closed-message p {
    font-size: 16px;
    color: var(--gray-medium);
    margin-bottom: 32px;
    line-height: 1.6;
}

.inscriptions-closed-message .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.inscriptions-closed-message .btn-primary:hover {
    background: var(--primary-dark);
}
