/* css/app.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:    #0078d4;
    --blue-dk: #005a9e;
    --green:   #107c10;
    --purple:  #5c2d91;
    --gray-50: #f8f8f8;
    --gray-100:#f0f0f0;
    --gray-200:#e0e0e0;
    --gray-600:#666;
    --gray-800:#222;
    --white:   #fff;
    --danger:  #a4262c;
    --radius:  8px;
    --shadow:  0 2px 8px rgba(0,0,0,.10);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Tout ce qui n'est pas le footer prend l'espace disponible */
body > *:not(footer) {
    flex-shrink: 0;
}

/* Le footer se colle toujours en bas */
body > footer {
    margin-top: auto;
}

/* ── Nav ──────────────────────────────────────────────────────────────── */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 56px;
}
nav .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--blue);
    text-decoration: none;
}
nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: .95rem;
    padding: .25rem .5rem;
    border-radius: 4px;
    transition: background .15s;
}
nav a:hover { background: var(--gray-100); color: var(--gray-800); }
nav a.active { color: var(--blue); font-weight: 500; }
nav .spacer { flex: 1; }
nav .user-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--gray-100);
    border-radius: 20px;
    padding: .25rem .75rem .25rem .5rem;
    font-size: .85rem;
    color: var(--gray-600);
}
nav .avatar {
    width: 28px; height: 28px;
    background: var(--blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: .75rem;
    font-weight: 700;
}
nav .btn-logout {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .3rem .9rem;
    font-size: .85rem;
    cursor: pointer;
    color: var(--gray-600);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
nav .btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #0078d4 0%, #5c2d91 100%);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero p  { font-size: 1.15rem; opacity: .9; max-width: 560px; margin: 0 auto 2rem; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: filter .15s;
}
.btn:hover { filter: brightness(.9); }
.btn-primary   { background: var(--blue);   color: var(--white); }
.btn-secondary { background: var(--white);  color: var(--blue);  border: 1px solid var(--blue); }
.btn-success   { background: var(--green);  color: var(--white); }
.btn-outline   { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.6); }

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; flex: 1;}
.section { padding: 4rem 0; }
.section-title { font-size: 1.6rem; font-weight: 600; margin-bottom: .5rem; }
.section-sub   { color: var(--gray-600); margin-bottom: 2.5rem; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}
.card-icon.blue   { background: #dbeafe; color: var(--blue); }
.card-icon.green  { background: #dcfce7; color: var(--green); }
.card-icon.purple { background: #ede9fe; color: var(--purple); }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.card p  { font-size: .9rem; color: var(--gray-600); }

/* ── Espace sécurisé ──────────────────────────────────────────────────── */
.secure-banner {
    background: var(--white);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .9rem;
    color: var(--gray-600);
    box-shadow: var(--shadow);
}
.secure-banner strong { color: var(--green); }

.user-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.user-avatar-lg {
    width: 64px; height: 64px;
    background: var(--blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-info h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: .25rem; }
.user-info .email { color: var(--gray-600); font-size: .95rem; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.attr-table th {
    text-align: left;
    padding: .6rem 1rem;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 500;
    font-size: .85rem;
    border-bottom: 1px solid var(--gray-200);
}
.attr-table td {
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
    font-family: monospace;
    font-size: .85rem;
    word-break: break-all;
}
.attr-table tr:last-child td { border-bottom: none; }
.attr-table tr:hover td { background: var(--gray-50); }

/* ── Alerts & Badges ──────────────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
.alert-danger  { background: #fee2e2; color: var(--danger); border-left: 3px solid var(--danger); }
.alert-success { background: #dcfce7; color: #166534; border-left: 3px solid var(--green); }

.badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    background: #ede9fe;
    color: var(--purple);
    margin: .1rem;
}

/* ── Page de connexion ────────────────────────────────────────────────── */
.login-wrap {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: .4rem;
}
.login-sub {
    font-size: .9rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}
.proto-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: .6rem;
}
.proto-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 1.25rem 0;
}
.btn-proto {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: .875rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-800);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    margin-bottom: .75rem;
}
.btn-proto:last-of-type { margin-bottom: 0; }
.btn-proto:hover { background: var(--gray-50); box-shadow: var(--shadow); }
.btn-proto.saml:hover { border-color: var(--blue); }
.btn-proto.oidc:hover { border-color: var(--green); }
.proto-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.proto-icon.saml { background: #dbeafe; }
.proto-icon.oidc { background: #dcfce7; }
.proto-text { text-align: left; flex: 1; }
.proto-text strong { display: block; font-size: .9rem; }
.proto-text span   { font-size: .78rem; color: var(--gray-600); }
.proto-tag {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.proto-tag.saml { background: #dbeafe; color: var(--blue); }
.proto-tag.oidc { background: #dcfce7; color: var(--green); }
.login-compare {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}
.login-compare-title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: .875rem;
}
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.compare-col {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .875rem;
}
.compare-col-title {
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.compare-col-title.blue  { color: var(--blue); }
.compare-col-title.green { color: var(--green); }
.compare-row {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: var(--gray-600);
    padding: .25rem 0;
    border-bottom: 1px solid var(--gray-200);
    gap: .5rem;
}
.compare-row:last-child { border-bottom: none; }
.compare-val { color: var(--gray-800); font-weight: 500; text-align: right; }
.login-back {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    font-size: .82rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color .15s;
}
.login-back:hover { color: var(--blue); }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
    background: var(--gray-800);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 1.5rem;
    font-size: .85rem;
    margin-top: auto;
}


/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.8rem; }
    nav { gap: 1rem; padding: 0 1rem; }
    .user-card { flex-direction: column; text-align: center; }
    .compare-grid { grid-template-columns: 1fr; }
    .login-card { padding: 1.75rem 1.25rem; }
}