/* ==========================================================================
   Global Styles - EcoRide Modern Redesign
   ========================================================================== */

/* ------------------------------------------
   CSS Variables
   ------------------------------------------ */
:root {
    --primary-color: #27ae60; /* A fresh, accessible green */
    --primary-color-dark: #229954;
    --secondary-color: #2c3e50; /* A deep, slate blue for text */
    --accent-color: #3498db; /* A nice blue for accents */
    --background-color: #f4f7f6; /* A slightly cooler light grey */
    --surface-color: #ffffff; /* For cards and containers */
    --border-color: #e9ecef;
    --text-color: #34495e;
    --text-color-light: #7f8c8d;
    --error-color: #e74c3c;
    --success-color: #27ae60;

    --font-family-main: 'Poppins', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition-main: all 0.3s ease-in-out;
}

/* ------------------------------------------
   Base & Typography
   ------------------------------------------ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-main);
}

a:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

/* ------------------------------------------
   Layout & Containers
   ------------------------------------------ */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.page-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex-grow: 1;
}

.home-page #site-content {
    padding-top: 0;
}

/* ------------------------------------------
   Buttons
   ------------------------------------------ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-main);
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #34495e;
}

/* ------------------------------------------
   Forms
   ------------------------------------------ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family-main);
    font-size: 1rem;
    transition: var(--transition-main);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

/* ------------------------------------------
   Error & Success Messages
   ------------------------------------------ */
.error-messages, .success-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.error-messages {
    background-color: #fbeae5;
    border-color: var(--error-color);
    color: var(--error-color);
}

.success-message {
    background-color: #eafaf1;
    border-color: var(--success-color);
    color: #229954;
}

/* Réinitialisation et structure */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--secondary-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.75s ease, visibility 0.75s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-logo {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite ease-in-out;
}

.preloader-logo-svg {
    width: 60px;
    height: 60px;
    display: block;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(39, 174, 96, 0.15);
    border-top: 5px solid #27ae60;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 2px 12px rgba(39, 174, 96, 0.08);
}

.loader-text {
    font-size: 1.1rem;
    color: var(--text-color-light);
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
    font-family: 'Poppins', sans-serif;
    animation: fadeIn 1.2s both;
}

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

/* Site content initial state */
#site-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-top: 80px; /* Hauteur de la nav-bar */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#site-content.visible {
    opacity: 1;
}

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

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

html {
    font-size: 16px;
}

/* Modern Legal Card */
.modern-legal-card {
    background: var(--surface-color);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(39, 174, 96, 0.08), 0 1.5px 6px rgba(44,62,80,0.04);
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 650px;
    margin: 2rem auto;
    position: relative;
    border: 1px solid var(--border-color);
}

.modern-legal-card h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.modern-legal-card section {
    margin-bottom: 2rem;
}

.modern-legal-card h2 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-legal-card p {
    color: var(--text-color);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.webcore-credit {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 1.08rem;
    color: var(--primary-color-dark);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.webcore-credit a {
    color: var(--primary-color-dark);
    text-decoration: underline;
    transition: color 0.2s;
}

.webcore-credit a:hover {
    color: var(--primary-color);
}


