/* =================================
   APPOINTMENT CSS PERSONNALISÉ
   Sans Bootstrap - Design Moderne
   ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS pour maintenir la cohérence */
:root {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-light: #e5e7eb;
    --border-focus: #3b82f6;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Base Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container Principal */
.appointment-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Formulaire Container */
.appointment-form-wrapper {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 60px 50px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(59, 130, 246, 0.1);
    width: 100%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.appointment-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

/* Header du formulaire */
.appointment-header {
    text-align: center;
    margin-bottom: 50px;
}

.appointment-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.appointment-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.appointment-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: var(--shadow-md);
}

/* Grille du formulaire */
.appointment-form {
    display: grid;
    gap: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.form-row.two-columns {
    grid-template-columns: 1fr 1fr;
}

/* Groupes de champs */
.input-group {
    position: relative;
}

.input-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.input-label.required::after {
    content: " *";
    color: var(--error-color);
    font-weight: 700;
}

/* Styles des inputs */
.input-field {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
    position: relative;
}

.input-field:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.input-field:hover:not(:focus) {
    border-color: #9ca3af;
}

.input-field::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Select personnalisé */
.select-field {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--white);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 20px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
}

.select-field:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.select-field:hover:not(:focus) {
    border-color: #9ca3af;
}

/* Textarea */
.textarea-field {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
    resize: vertical;
    min-height: 120px;
}

.textarea-field:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.textarea-field:hover:not(:focus) {
    border-color: #9ca3af;
}

/* États de validation */
.input-field.valid,
.select-field.valid,
.textarea-field.valid {
    border-color: var(--success-color);
}

.input-field.invalid,
.select-field.invalid,
.textarea-field.invalid {
    border-color: var(--error-color);
}

.input-field.invalid:focus,
.select-field.invalid:focus,
.textarea-field.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Icônes dans les inputs */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

.input-with-icon .input-field {
    padding-left: 50px;
}

/* Boutons */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btm {
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.btm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btm:hover::before {
    left: 100%;
}

.btm-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btm-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(59, 130, 246, 0.3);
}

.btm-primary:active {
    transform: translateY(0);
}

.btm-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.btm-secondary:hover {
    background: #f9fafb;
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btm:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Messages d'alerte */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.appointment-form-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

.input-group {
    animation: slideInLeft 0.4s ease-out;
    animation-fill-mode: both;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.15s; }
.input-group:nth-child(3) { animation-delay: 0.2s; }
.input-group:nth-child(4) { animation-delay: 0.25s; }
.input-group:nth-child(5) { animation-delay: 0.3s; }
.input-group:nth-child(6) { animation-delay: 0.35s; }
.input-group:nth-child(7) { animation-delay: 0.4s; }

.button-group {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* Progress Indicator */
.form-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-bottom: 30px;
    overflow: hidden;
}

.form-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Loading State */
.btm.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btm.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .appointment-container {
        padding: 20px 16px;
    }
    
    .appointment-form-wrapper {
        padding: 40px 30px;
    }
    
    .appointment-title {
        font-size: 2rem;
    }
    
    .form-row.two-columns {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btm {
        width: 100%;
        min-width: auto;
    }
    
    .appointment-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .appointment-container {
        padding: 16px 12px;
    }
    
    .appointment-form-wrapper {
        padding: 30px 20px;
    }
    
    .appointment-title {
        font-size: 1.75rem;
    }
    
    .input-field,
    .select-field,
    .textarea-field {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .btm {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .appointment-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .input-with-icon .input-field {
        padding-left: 45px;
    }
    
    .input-icon {
        font-size: 16px;
        left: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #111827;
        --white: #1f2937;
        --text-dark: #f9fafb;
        --text-light: #9ca3af;
        --border-light: #374151;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .input-field,
    .select-field,
    .textarea-field {
        border-width: 3px;
    }
    
    .btm {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .appointment-container {
        padding: 0;
        min-height: auto;
    }
    
    .appointment-form-wrapper {
        box-shadow: none;
        border: 1px solid #000;
        padding: 20px;
    }
    
    .btm {
        display: none;
    }
    
    .form-progress {
        display: none;
    }
}

/* Focus visible polyfill */
.input-field:focus-visible,
.select-field:focus-visible,
.textarea-field:focus-visible,
.btm:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-dark);
}