/* ============================================
   ELSANOR - Pages Publiques (Accueil, Connexion)
   ============================================ */

/* === Variables === */
:root {
    --elsanor-primary: #2c5282;
    --elsanor-primary-dark: #1a365d;
    --elsanor-primary-light: #4299e1;
    --elsanor-secondary: #718096;
    --elsanor-success: #48bb78;
    --elsanor-warning: #ed8936;
    --elsanor-danger: #e53e3e;
    --elsanor-light: #f7fafc;
    --elsanor-dark: #1a202c;
    --elsanor-gradient: linear-gradient(135deg, var(--elsanor-primary) 0%, var(--elsanor-primary-dark) 100%);
    --elsanor-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --elsanor-shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --elsanor-radius: 16px;
    --elsanor-radius-sm: 8px;
}

/* === Base === */
.public-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
}

.public-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* === Header === */
.public-header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.public-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.public-logo img {
    height: 50px;
    margin-right: 15px;
}

.public-logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.public-nav {
    display: flex;
    gap: 10px;
}

.public-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--elsanor-radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
}

.public-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.public-nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* === Main Content === */
.public-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* === Cards === */
.public-card {
    background: white;
    border-radius: var(--elsanor-radius);
    box-shadow: var(--elsanor-shadow);
    overflow: hidden;
    max-width: 100%;
    animation: fadeInUp 0.6s ease;
}

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

.public-card-header {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.public-card-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.public-card-header p {
    margin: 10px 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.public-card-body {
    padding: 40px;
}

/* === Login Form === */
.login-card {
    width: 420px;
}

.login-form .form-label {
    font-weight: 500;
    color: var(--elsanor-dark);
    margin-bottom: 8px;
}

.login-form .form-control {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--elsanor-radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--elsanor-primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.login-form .input-group-text {
    background: var(--elsanor-light);
    border: 2px solid #e2e8f0;
    border-right: none;
    color: var(--elsanor-secondary);
}

.login-form .input-group .form-control {
    border-left: none;
}

.login-form .input-group:focus-within .input-group-text {
    border-color: var(--elsanor-primary);
}

.login-form .input-group:focus-within .form-control {
    border-color: var(--elsanor-primary);
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--elsanor-radius-sm);
    background: var(--elsanor-gradient);
    border: none;
    color: white;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(44, 82, 130, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-links {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.login-links a {
    color: var(--elsanor-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.login-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--elsanor-primary);
}

/* === Home Page === */
.home-container {
    max-width: 1200px;
    width: 100%;
}

.home-hero {
    text-align: center;
    color: white;
    margin-bottom: 60px;
}

.home-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.home-hero p {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.home-card {
    background: white;
    border-radius: var(--elsanor-radius);
    box-shadow: var(--elsanor-shadow);
    overflow: hidden;
    transition: all 0.4s ease;
    animation: fadeInUp 0.6s ease backwards;
}

.home-card:nth-child(1) { animation-delay: 0.1s; }
.home-card:nth-child(2) { animation-delay: 0.2s; }
.home-card:nth-child(3) { animation-delay: 0.3s; }

.home-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.home-card-icon {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
}

.home-card-icon.logistique {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.home-card-icon.production {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.home-card-icon.elwes {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.home-card-body {
    padding: 30px;
    text-align: center;
}

.home-card-body h3 {
    color: var(--elsanor-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.home-card-body p {
    color: var(--elsanor-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.home-card-body .phone {
    display: block;
    color: var(--elsanor-primary);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.home-card-body .phone i {
    margin-right: 8px;
}

.home-card-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-card-btn.logistique {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.home-card-btn.production {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.home-card-btn.elwes {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.home-card-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    color: white;
}

.home-card-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* === Contact Section === */
.contact-section {
    margin-top: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--elsanor-radius);
    padding: 40px;
    color: white;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.contact-form .form-control,
.contact-form .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 16px;
    border-radius: var(--elsanor-radius-sm);
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.contact-form textarea {
    min-height: 120px;
}

.contact-btn {
    background: white;
    color: var(--elsanor-primary);
    font-weight: 600;
    padding: 12px 40px;
    border-radius: 50px;
    border: none;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

/* === Footer === */
.public-footer {
    padding: 20px 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

.public-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.public-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* === Login Type Indicator === */
.login-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-top: 15px;
}

.login-type-badge i {
    font-size: 1rem;
}

/* === Alerts === */
.public-alert {
    padding: 15px 20px;
    border-radius: var(--elsanor-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.public-alert i {
    font-size: 1.2rem;
}

.public-alert-danger {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #e53e3e;
}

.public-alert-success {
    background: #c6f6d5;
    color: #276749;
    border-left: 4px solid #48bb78;
}

/* === Responsive === */
@media (max-width: 768px) {
    .public-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .public-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .home-hero h1 {
        font-size: 2.5rem;
    }

    .home-hero p {
        font-size: 1.1rem;
    }

    .login-card {
        width: 100%;
        max-width: 400px;
    }

    .public-card-header {
        padding: 25px 30px;
    }

    .public-card-body {
        padding: 30px;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .contact-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .home-hero h1 {
        font-size: 2rem;
    }

    .public-logo-text {
        font-size: 1.4rem;
    }
}

/* === Language Selector (Public Pages) === */
.public-language-selector {
    position: relative;
    display: inline-block;
}

.public-language-selector .dropdown-toggle {
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: var(--elsanor-radius-sm) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.public-language-selector .dropdown-toggle:hover,
.public-language-selector .dropdown-toggle:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
}

.public-language-selector .dropdown-toggle::after {
    display: none !important;
}

.public-language-selector .dropdown-toggle .fi {
    font-size: 1.2rem;
    border-radius: 2px;
}

.public-language-selector .dropdown-menu {
    background: white;
    border: none;
    border-radius: var(--elsanor-radius-sm);
    box-shadow: var(--elsanor-shadow);
    min-width: 150px;
    padding: 8px 0;
    z-index: 1050;
}

.public-language-selector .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--elsanor-dark);
    transition: all 0.2s ease;
}

.public-language-selector .dropdown-item:hover {
    background: var(--elsanor-light);
}

.public-language-selector .dropdown-item.active {
    background: var(--elsanor-primary);
    color: white;
}

.public-language-selector .dropdown-item .fi {
    font-size: 1rem;
    border-radius: 2px;
}
