/**
 * Portal Design System - menuiseriesurmeisure.fr
 * Modern, aerisit, profesional
 * Parteneriat Clear Enterprise + Amira
 */

/* === CSS Variables === */
:root {
    /* Colors - Clean, Professional */
    --primary: #003168;
    --primary-light: #0a4a8a;
    --primary-dark: #001f42;
    --accent: #ef7c1a;
    --accent-hover: #ff8f2e;
    --accent-light: rgba(239, 124, 26, 0.1);

    /* Neutrals */
    --bg-main: #fafbfc;
    --bg-card: #ffffff;
    --bg-subtle: #f4f6f8;
    --bg-dark: #0d1117;

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    --border: #e5e7eb;
    --border-light: #f0f1f3;

    /* Status */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    --font-display: "DM Serif Display", Georgia, serif;
    --font-mono: "DM Mono", "Fira Code", monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Container */
    --container-max: 1280px;
    --sidebar-width: 280px;
}

/* === Base Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.5rem;
}
h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* === Layout === */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.page-layout {
    display: flex;
    min-height: 100vh;
}

.page-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.page-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.sidebar-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.sidebar-logos img {
    height: 40px;
    object-fit: contain;
}

.sidebar-logos .separator {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 300;
}

.sidebar-title {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* GMeet Quick Access */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
}

.gmeet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.gmeet-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.gmeet-btn .icon {
    font-size: 1.2rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
}

/* === Dashboard Grid === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.dashboard-header {
    margin-bottom: var(--space-xl);
}

.dashboard-welcome {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.dashboard-welcome strong {
    color: var(--text-primary);
}

.dashboard-subtitle {
    color: var(--text-muted);
}

/* === Progress Components === */
.progress-bar-container {
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        var(--accent-hover) 100%
    );
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

/* === Phase Timeline === */
.phase-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.phase-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    transition: all var(--transition-fast);
}

.phase-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.phase-indicator {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.phase-indicator.done {
    background: var(--success);
    color: white;
}

.phase-indicator.active {
    background: var(--accent);
    color: white;
    animation: pulse 2s infinite;
}

.phase-indicator.pending {
    background: var(--border);
    color: var(--text-muted);
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 124, 26, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 124, 26, 0);
    }
}

.phase-content {
    flex: 1;
}

.phase-name {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.phase-progress {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* === Action Cards === */
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-xl);
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-4px);
}

.action-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}

.action-icon.configurator {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.action-icon.mockups {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
}

.action-icon.help {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.action-icon.progress {
    background: linear-gradient(135deg, var(--accent) 0%, #c75c00 100%);
    color: white;
}

.action-card:hover .action-icon {
    transform: scale(1.1);
}

.action-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.action-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    color: white;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.0625rem;
}

/* === Forms === */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: var(--space-sm);
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-main) 0%, #e8eef5 100%);
    padding: var(--space-lg);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    padding: var(--space-2xl);
    text-align: center;
    color: white;
}

.login-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.login-logos img {
    height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-logos .separator {
    font-size: 1.5rem;
    opacity: 0.5;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    font-family: var(--font-sans);
}

.login-subtitle {
    opacity: 0.8;
    font-size: 0.9375rem;
}

.login-body {
    padding: var(--space-2xl);
}

.login-footer {
    padding: var(--space-lg) var(--space-2xl);
    background: var(--bg-subtle);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}

/* === Utilities === */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.text-muted {
    color: var(--text-muted);
}
.text-accent {
    color: var(--accent);
}
.text-success {
    color: var(--success);
}

.mt-sm {
    margin-top: var(--space-sm);
}
.mt-md {
    margin-top: var(--space-md);
}
.mt-lg {
    margin-top: var(--space-lg);
}
.mt-xl {
    margin-top: var(--space-xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}
.mb-md {
    margin-bottom: var(--space-md);
}
.mb-lg {
    margin-bottom: var(--space-lg);
}
.mb-xl {
    margin-bottom: var(--space-xl);
}

.flex {
    display: flex;
}
.flex-center {
    align-items: center;
    justify-content: center;
}
.flex-between {
    justify-content: space-between;
}
.gap-sm {
    gap: var(--space-sm);
}
.gap-md {
    gap: var(--space-md);
}
.gap-lg {
    gap: var(--space-lg);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .page-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .page-sidebar.open {
        transform: translateX(0);
    }

    .page-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 20px;
        --space-xl: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .login-logos img {
        height: 40px;
    }

    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-in {
    animation: slideIn var(--transition-normal) ease-out;
}

/* Stagger children */
.stagger-children > * {
    animation: fadeIn var(--transition-normal) ease-out backwards;
}

.stagger-children > *:nth-child(1) {
    animation-delay: 0ms;
}
.stagger-children > *:nth-child(2) {
    animation-delay: 50ms;
}
.stagger-children > *:nth-child(3) {
    animation-delay: 100ms;
}
.stagger-children > *:nth-child(4) {
    animation-delay: 150ms;
}
.stagger-children > *:nth-child(5) {
    animation-delay: 200ms;
}
.stagger-children > *:nth-child(6) {
    animation-delay: 250ms;
}
