/**
 * AdmHost — Interface publique (vitrine + console client)
 * Thème orange foncé, responsive mobile-first
 */

:root {
    --bg: #14100d;
    --bg-elevated: #1c1612;
    --bg-card: #231c17;
    --border: #3a2f28;
    --text: #f5f0eb;
    --text-muted: #a8988c;
    --accent: #ea580c;
    --accent-hover: #f97316;
    --accent-dark: #9a3412;
    --accent-soft: rgba(234, 88, 12, 0.12);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(20, 16, 13, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.nav-brand span { color: var(--accent); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.925rem;
    border-radius: var(--radius);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.925rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

/* --- Hero --- */
.hero {
    padding: 4rem 0 3rem;
    max-width: 720px;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(234, 88, 12, 0.25);
    border-radius: 999px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- Features --- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0 3rem;
}

.feature-card {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature-card p {
    font-size: 0.925rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- Pricing --- */
.pricing { padding: 1rem 0 2rem; }

.pricing > h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.pricing-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.pricing-card {
    background: var(--bg-card);
    padding: 2rem 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.pricing-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pricing-card ul {
    list-style: none;
    margin: 0 0 1.5rem;
    flex: 1;
}

.pricing-card li {
    padding: 0.45rem 0;
    font-size: 0.925rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.pricing-card li::before {
    content: "—";
    color: var(--accent);
    margin-right: 0.5rem;
}

/* --- Auth --- */
.auth-form {
    max-width: 420px;
    margin: 2rem auto 3rem;
    background: var(--bg-card);
    padding: 2rem 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-form h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Dashboard --- */
.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dashboard-section { margin-bottom: 2rem; }

.dashboard-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.text-muted { color: var(--text-muted); }

.sub-card {
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.sub-card.sub-cancelled { border-left-color: var(--error); }
.sub-card.sub-past_due { border-left-color: #f59e0b; }

.sub-plan { font-size: 1.1rem; font-weight: 600; display: block; }
.sub-amount { color: var(--text-muted); font-size: 0.9rem; }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-active { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.status-pending { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.status-past_due { background: rgba(245, 158, 11, 0.15); color: #fdba74; }

.service-card {
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.service-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.cred-block {
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.cred-block h4 {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cred-block dl {
    display: grid;
    grid-template-columns: minmax(80px, 100px) 1fr;
    gap: 0.35rem 0.5rem;
    font-size: 0.875rem;
}

.cred-block dt { color: var(--text-muted); font-weight: 500; }
.cred-block dd { margin: 0; word-break: break-all; }

.cred-block code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text);
}

.empty-state {
    background: var(--bg-card);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
    font-size: 0.875rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        gap: 0.25rem;
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
        box-shadow: var(--shadow);
    }

    .nav-links.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a,
    .nav-links .btn {
        width: 100%;
        text-align: center;
    }

    .hero { padding: 2.5rem 0 2rem; }

    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }

    .dashboard-header { flex-direction: column; align-items: flex-start; }

    .cred-block dl { grid-template-columns: 1fr; }
    .cred-block dt { margin-top: 0.5rem; }
}

@media (min-width: 769px) {
    body:not(.console-body) { display: flex; flex-direction: column; min-height: 100vh; }
    main.container { flex: 1; }
}

/* --- Console client (sidebar) --- */
body.console-body {
    display: flex;
    min-height: 100vh;
    margin: 0;
}

.console-sidebar {
    width: 220px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    flex-shrink: 0;
}

.console-brand {
    font-weight: 700;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.console-nav { display: flex; flex-direction: column; }
.console-nav a {
    padding: 0.65rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
}
.console-nav a:hover, .console-nav a.active {
    background: var(--accent-soft);
    color: var(--text);
}
.console-nav-danger { color: #f87171 !important; }

.console-main {
    flex: 1;
    padding: 1.5rem;
    max-width: 960px;
    min-width: 0;
}

.console-nav-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dashboard-stats { margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-card p { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); margin-top: 0.35rem; }
.stat-sm { font-size: 1.1rem !important; }

.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.data-table th, .data-table td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.data-table th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }

.form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

@media (max-width: 768px) {
    body.console-body { flex-direction: column; }
    .console-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s;
        box-shadow: var(--shadow);
    }
    .console-sidebar.is-open { transform: translateX(0); }
    .console-nav-toggle { display: block; }
    .console-main { padding: 1rem; padding-bottom: 4rem; }
}
