/* ============================================================================
   YCLOUD — public/assets/css/app.css
   ZIP01 : reset + typo + layout auth + composants base + couleurs CIELO-like
   ============================================================================ */

:root {
    /* Palette principale */
    --c-bg:        #f5f6f8;
    --c-surface:   #ffffff;
    --c-surface-2: #f9fafb;
    --c-border:    #e5e7eb;
    --c-border-2:  #d1d5db;

    --c-text:      #1f2937;
    --c-text-soft: #6b7280;
    --c-text-mute: #9ca3af;

    --c-primary:    #2563eb;
    --c-primary-h:  #1d4ed8;
    --c-primary-bg: #eff6ff;

    --c-success:    #16a34a;
    --c-success-bg: #dcfce7;
    --c-warning:    #d97706;
    --c-warning-bg: #fef3c7;
    --c-danger:     #dc2626;
    --c-danger-bg:  #fee2e2;

    /* Espacements */
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-8: 3rem;

    --radius: 6px;
    --radius-lg: 10px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .875em;
}
code {
    background: var(--c-surface-2);
    padding: .12em .35em;
    border-radius: 3px;
    border: 1px solid var(--c-border);
}
pre {
    background: var(--c-surface-2);
    padding: var(--sp-3);
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    overflow-x: auto;
}
pre code { background: transparent; border: 0; padding: 0; }

/* ============================================================================
   Layout AUTH (login, mfa, health page)
============================================================================ */

.layout-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.auth-shell {
    width: 100%;
    max-width: 720px;
}
.auth-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--sp-6);
    border: 1px solid var(--c-border);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--c-border);
}
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-h));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .5px;
}
.brand-name {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: .3px;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--sp-1);
}
.auth-sub {
    color: var(--c-text-soft);
    margin: 0 0 var(--sp-5);
    font-size: .9rem;
}
.auth-footer {
    margin-top: var(--sp-5);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-border);
    color: var(--c-text-mute);
    font-size: .8rem;
    text-align: center;
}

/* ============================================================================
   Health Status
============================================================================ */

.health-status {
    padding: var(--sp-4);
    border-radius: var(--radius);
    margin-bottom: var(--sp-5);
    border: 1px solid;
}
.health-status--ok {
    background: var(--c-success-bg);
    border-color: var(--c-success);
    color: #14532d;
}
.health-status--ko {
    background: var(--c-danger-bg);
    border-color: var(--c-danger);
    color: #7f1d1d;
}

.health-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: .9rem;
}
.health-table th, .health-table td {
    padding: var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}
.health-table th {
    background: var(--c-surface-2);
    font-weight: 600;
    color: var(--c-text-soft);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.health-table tr:last-child td { border-bottom: 0; }
.health-row--ko { background: var(--c-danger-bg); }
.health-row--warn { background: var(--c-warning-bg); }

.health-details {
    margin-top: var(--sp-5);
    padding: var(--sp-3);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}
.health-details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--c-text-soft);
}
.health-details[open] summary {
    margin-bottom: var(--sp-3);
}

/* ============================================================================
   Badges
============================================================================ */

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.badge--ok    { background: var(--c-success-bg); color: var(--c-success); }
.badge--warn  { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--ko    { background: var(--c-danger-bg);  color: var(--c-danger); }
.badge--info  { background: var(--c-primary-bg); color: var(--c-primary); }

/* ============================================================================
   Composants formulaires (preparation ZIP02+)
============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: .9rem;
    transition: background .15s, border-color .15s;
    text-decoration: none;
    cursor: pointer;
}
.btn--primary {
    background: var(--c-primary);
    color: #fff;
}
.btn--primary:hover { background: var(--c-primary-h); }
.btn--secondary {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border-2);
}
.btn--secondary:hover { background: var(--c-surface-2); }
.btn--danger {
    background: var(--c-danger);
    color: #fff;
}

.input, .select, .textarea {
    width: 100%;
    padding: .55rem .75rem;
    border-radius: var(--radius);
    border: 1px solid var(--c-border-2);
    background: var(--c-surface);
    font: inherit;
    color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* ============================================================================
   Layout MAIN (sera enrichi au ZIP02 avec sidebar/topbar)
============================================================================ */

.layout-main {
    min-height: 100vh;
}
.main-shell {
    padding: var(--sp-5);
    max-width: 1280px;
    margin: 0 auto;
}

/* ============================================================================
   Responsive (mobile first)
============================================================================ */

@media (max-width: 640px) {
    .auth-card { padding: var(--sp-4); }
    .auth-title { font-size: 1.2rem; }
    .health-table { font-size: .8rem; }
    .health-table th, .health-table td { padding: var(--sp-2); }
}
