/* ========================================
   ASSETVALUE CONSULTING - PORTAIL INTERNE
   Couleurs : Bleu primaire #0052CC, Gris corporatif
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0052CC;
    --primary-dark: #003D99;
    --primary-light: #E8F0FF;
    --light-gray: #F5F7FA;
    --dark-gray: #2C3E50;
    --border-gray: #E1E8ED;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --white: #FFFFFF;
    --success: #28A745;
    --error: #DC3545;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== TYPOGRAPHIE ========== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ========== HEADER ========== */
header {
    background-color: #1c2538;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-gray);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container a {
    display: inline-flex;
}

.logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    transition: var(--transition);
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: var(--primary-light);
}

.nav-link-btn {
    background-color: transparent;
    color: var(--white) !important;
    padding: 0;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 1.1rem;
}

.nav-link-btn:hover {
    color: var(--primary-light) !important;
}

.nav-avatar {
    margin-left: 0.25rem;
}

.nav-avatar-link {
    display: inline-flex;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-avatar-link:hover {
    border-color: var(--primary-light);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.nav-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-avatar-placeholder {
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

.nav-btn {
    background-color: var(--primary-blue);
    color: var(--white) !important;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    background-color: var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
    transform: translateY(-2px);
}

.logout-btn {
    background-color: var(--primary-blue);
    color: var(--white) !important;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.logout-btn:hover {
    background-color: var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
    transform: translateY(-2px);
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('../images/BackGround-Login.png');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    padding: 1rem;
}

.login-box {
    background-color: #1c2538;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-40px);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    background-color: #1c2538;
    padding: 2rem;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-subtitle {
    text-align: center;
    color: #CFD8E3;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    background-color: var(--white);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: var(--white);
}

.login-btn {
    width: 100%;
    padding: 0.95rem;
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.login-btn:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.3);
    transform: translateY(-2px);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    background-color: #FFE8E8;
    color: #C33;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error);
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
}

.login-footer {
    color: var(--text-muted);
}

/* ========== HOME PAGE ========== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

.welcome-section {
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ========== PORTAL GRID ========== */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

/* ========== PORTAL CARDS ========== */
.portal-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-gray);
    position: relative;
    overflow: hidden;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-card:hover::before {
    left: 100%;
}

.portal-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 82, 204, 0.2);
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
}

.portal-card a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    gap: 1rem;
}

.portal-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.portal-card:hover .portal-icon {
    transform: scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 4px 12px rgba(0, 82, 204, 0.25));
}

.portal-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: color 0.3s ease;
}

.portal-card:hover .portal-label {
    color: var(--primary-blue);
}

.portal-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: 0.5rem;
}

.portal-card:hover .portal-description {
    opacity: 1;
}

/* ========== FOOTER ========== */
footer {
    background-color: var(--dark-gray);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .logo {
        height: 40px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logout-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .login-box {
        padding: 2rem;
        margin: 1rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portal-card {
        min-height: 240px;
        padding: 2rem;
    }

    .portal-icon {
        width: 80px;
        height: 80px;
    }

    .portal-label {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .login-box {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .portal-card {
        min-height: 200px;
        padding: 1.5rem;
    }

    .portal-icon {
        width: 70px;
        height: 70px;
    }
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.portal-card {
    animation: fadeIn 0.4s ease-out backwards;
}

.portal-card:nth-child(1) { animation-delay: 0.1s; }
.portal-card:nth-child(2) { animation-delay: 0.2s; }
.portal-card:nth-child(3) { animation-delay: 0.3s; }
.portal-card:nth-child(4) { animation-delay: 0.4s; }
