/* /var/www/html/crm/assets/css/main.css — Charte globale CRM Blitech */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --navy: #092660;
    --beige: #F4D793;
    --fond: #061840;
    --fond-card: #0a2a6a;
    --text: #FAF0D0;
    --text-muted: rgba(244, 215, 147, 0.5);
    --border: rgba(244, 215, 147, 0.12);
    --danger: #e74c3c;
    --success: #27ae60;
    --radius: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--fond);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    color: var(--beige);
}

a {
    color: var(--beige);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Login ─────────────────────────────────────────────── */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--navy);
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-logo {
    height: 48px;
    margin-bottom: 16px;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 32px;
}

.login-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--beige);
}

.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--beige);
    color: var(--fond);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    opacity: 0.9;
}

/* ─── Topbar ────────────────────────────────────────────── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--navy);
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo {
    height: 28px;
}

.topbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 900;
    color: var(--beige);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ─── Theme toggle button ──────────────────────────────── */

.btn-theme {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 10px;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1;
}

.btn-theme:hover {
    color: var(--beige);
    border-color: var(--beige);
}

body:not(.light) .btn-theme .icon-sun  { display: inline; }
body:not(.light) .btn-theme .icon-moon { display: none; }
body.light .btn-theme .icon-sun  { display: none; }
body.light .btn-theme .icon-moon { display: inline; }

/* ─── Utilities ─────────────────────────────────────────── */

.flash-success {
    animation: flashGreen 0.6s ease-out;
}

.flash-error {
    animation: flashRed 0.6s ease-out;
}

@keyframes flashGreen {
    0% { background-color: rgba(39, 174, 96, 0.3); }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: rgba(231, 76, 60, 0.3); }
    100% { background-color: transparent; }
}

/* ─── Thème clair ──────────────────────────────────────── */

body.light {
    --fond: #f0ebe0;
    --navy: #e8dfc8;
    --fond-card: #faf6ed;
    --text: #1a2340;
    --text-muted: rgba(9, 38, 96, 0.5);
    --border: rgba(9, 38, 96, 0.12);
    --beige: #092660;
}

body.light h1,
body.light h2,
body.light h3 {
    color: #092660;
}

body.light a {
    color: #092660;
}

body.light .login-card {
    background: #faf6ed;
    box-shadow: 0 8px 40px rgba(9, 38, 96, 0.12);
}

body.light .btn-login {
    background: #092660;
    color: #F4D793;
}

body.light .topbar {
    background: #e8dfc8;
    border-bottom-color: rgba(9, 38, 96, 0.1);
}

body.light .topbar-title {
    color: #092660;
}

body.light .btn-logout {
    color: #1a2340;
    border-color: rgba(9, 38, 96, 0.15);
}

body.light .btn-logout:hover {
    background: rgba(9, 38, 96, 0.08);
}

body.light .btn-theme {
    color: rgba(9, 38, 96, 0.45);
    border-color: rgba(9, 38, 96, 0.15);
}

body.light .btn-theme:hover {
    color: #092660;
    border-color: #092660;
}

body.light .form-group input {
    background: #faf6ed;
    border-color: rgba(9, 38, 96, 0.15);
    color: #1a2340;
}

body.light .form-group label {
    color: rgba(9, 38, 96, 0.5);
}
