/* ===== SMF Web - Professional Design System ===== */

:root {
    /* Primary - Deep navy (trust, authority) */
    --smf-primary: #1a2332;
    --smf-primary-light: #243044;

    /* Accent - Refined teal (security, professionalism) */
    --smf-accent: #0f766e;
    --smf-accent-hover: #0d9488;
    --smf-accent-light: #f0fdfa;

    /* Secondary - Warm slate */
    --smf-secondary: #475569;

    /* Backgrounds - Clean, light */
    --smf-bg: #ffffff;
    --smf-bg-alt: #f8fafc;
    --smf-surface: #ffffff;
    --smf-surface-2: #f1f5f9;

    /* Borders */
    --smf-border: #e2e8f0;
    --smf-border-hover: #cbd5e1;

    /* Text */
    --smf-text: #1e293b;
    --smf-text-muted: #64748b;
    --smf-text-dim: #94a3b8;

    /* Semantic */
    --smf-success: #059669;
    --smf-danger: #dc2626;
    --smf-warning: #d97706;

    /* Spacing & radius */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--smf-bg);
    color: var(--smf-text);
    margin: 0;
    padding: 0;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* ===== Typography ===== */
h1:focus, h2:focus, h3:focus { outline: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--smf-primary);
}

.text-gradient {
    color: var(--smf-accent);
}

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

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== Navigation ===== */
.smf-navbar {
    background: var(--smf-bg);
    border-bottom: 1px solid var(--smf-border);
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.smf-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
}

.smf-logo .logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.smf-logo .brand {
    color: var(--smf-primary);
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
}

.smf-logo .brand-short { font-size: 1.35rem; font-weight: 700; white-space: nowrap; }
.smf-logo .brand-mid {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--smf-text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smf-logo .brand-long {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--smf-text-dim);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .smf-logo .brand-short { font-size: 1.05rem; }
    .smf-logo .brand-mid { font-size: 0.65rem; }
    .smf-logo .brand-long { font-size: 0.6rem; }
    .smf-logo .logo-img { width: 32px; height: 32px; }
    .smf-logo { gap: 0.4rem; }
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--smf-text);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle:checked ~ .nav-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle:checked ~ .nav-hamburger span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked ~ .nav-hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

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

.smf-nav-links a:not(.btn-smf) {
    color: var(--smf-text-muted);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.2s, background 0.2s;
}

.smf-nav-links a:not(.btn-smf):hover,
.smf-nav-links a:not(.btn-smf).active {
    color: var(--smf-text);
    background: var(--smf-surface-2);
}

/* ===== Language Switcher ===== */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: var(--smf-bg);
    color: var(--smf-text);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.lang-dropdown > summary::-webkit-details-marker { display: none; }
.lang-dropdown > summary::marker { content: ""; }
.lang-dropdown > summary:hover { border-color: var(--smf-border-hover); }

.lang-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    display: inline-block;
    vertical-align: middle;
}

.lang-caret { font-size: 0.7rem; color: var(--smf-text-muted); margin-left: 0.15rem; }

.lang-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    margin: 0;
    padding: 0.3rem 0;
    list-style: none;
    background: var(--smf-surface);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 170px;
    z-index: 100;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    color: var(--smf-text);
    text-decoration: none;
    font-size: 0.88rem;
}

.lang-item:hover { background: var(--smf-surface-2); }
.lang-active { background: var(--smf-accent-light); font-weight: 600; }

/* RTL */
html[dir="rtl"] { direction: rtl; text-align: right; }
html[dir="rtl"] .smf-navbar { flex-direction: row-reverse; }
html[dir="rtl"] .smf-nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .hero-buttons { flex-direction: row-reverse; }
html[dir="rtl"] .pricing-features li { flex-direction: row-reverse; text-align: right; }

/* ===== Buttons ===== */
.btn-smf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn-smf-primary {
    background: var(--smf-accent);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-smf-primary:hover {
    background: var(--smf-accent-hover);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
    color: white;
}

.btn-smf-success {
    background: var(--smf-success);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-smf-success:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    color: white;
}

.btn-smf-secondary {
    background: var(--smf-bg);
    color: var(--smf-text);
    border: 1px solid var(--smf-border);
}

.btn-smf-secondary:hover {
    background: var(--smf-surface-2);
    border-color: var(--smf-border-hover);
    color: var(--smf-text);
}

.btn-smf-ghost {
    background: transparent;
    color: var(--smf-text-muted);
    padding: 0.5rem 0.9rem;
}

.btn-smf-ghost:hover {
    color: var(--smf-accent);
    background: var(--smf-accent-light);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* ===== Hero ===== */
.hero {
    padding: 6rem 2rem 5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--smf-bg) 0%, var(--smf-bg-alt) 100%);
    border-bottom: 1px solid var(--smf-border);
}

.hero-content {
    max-width: 780px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.5rem;
    background: var(--smf-accent-light);
    border: 1px solid #ccfbf1;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    color: var(--smf-accent);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    color: var(--smf-primary);
}

.hero p {
    font-size: 1.12rem;
    color: var(--smf-text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Features ===== */
.features-section {
    padding: 5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--smf-text-muted);
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto;
}

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

.feature-card {
    background: var(--smf-surface);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon title"
        "icon desc";
    column-gap: 1.1rem;
    row-gap: 0.3rem;
    align-items: start;
}

.feature-card:hover {
    border-color: var(--smf-border-hover);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.feature-card .feature-icon { grid-area: icon; align-self: start; }
.feature-card h3 { grid-area: title; align-self: end; }
.feature-card p { grid-area: desc; margin: 0; }

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.feature-icon .feature-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.feature-icon.cyan { background: #f0fdfa; color: var(--smf-accent); }
.feature-icon.purple { background: #f5f3ff; color: #7c3aed; }
.feature-icon.green { background: #ecfdf5; color: var(--smf-success); }

.feature-card h3 {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 600;
    color: var(--smf-primary);
}

.feature-card p {
    color: var(--smf-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== Industries ===== */
.industries-section {
    padding: 5rem 2rem;
    background: var(--smf-primary);
}

.industries-section .section-header h2 {
    color: #ffffff;
}

.industries-section .section-header p {
    color: rgba(255, 255, 255, 0.65);
}

.industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.industry-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon title"
        "icon desc";
    column-gap: 1.1rem;
    row-gap: 0.3rem;
    align-items: start;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.industry-card .industry-icon { grid-area: icon; align-self: start; }
.industry-card h4 { grid-area: title; align-self: end; }
.industry-card p { grid-area: desc; margin: 0; }

.industry-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.industry-icon {
    font-size: 3rem;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.industry-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #ffffff;
}

.industry-card p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

/* ===== Pricing ===== */
.pricing-section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.pricing-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
    .pricing-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .pricing-grid-5 { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
}

.pricing-card {
    background: var(--smf-surface);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    transition: box-shadow 0.2s;
}

.pricing-card.featured {
    border-color: var(--smf-accent);
    box-shadow: 0 4px 20px rgba(15, 118, 110, 0.12);
}

.pricing-card.featured::before {
    content: 'Populaire';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--smf-accent);
    color: white;
    padding: 0.2rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.pricing-tier {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--smf-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--smf-primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.pricing-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--smf-text-muted);
}

.pricing-desc {
    color: var(--smf-text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--smf-border);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--smf-text-muted);
}

.pricing-features li .check {
    color: var(--smf-success);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--smf-bg-alt);
}

.auth-card {
    background: var(--smf-surface);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.auth-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: var(--smf-primary);
}

.auth-card .subtitle {
    color: var(--smf-text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.92rem;
}

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

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

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--smf-bg);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius);
    color: var(--smf-text);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--smf-accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-input::placeholder {
    color: var(--smf-text-dim);
}

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

.auth-link a {
    color: var(--smf-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--smf-danger);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--smf-success);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* ===== Dashboard ===== */
.dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.dashboard h1 {
    font-size: 1.75rem;
    margin-bottom: 1.75rem;
    color: var(--smf-primary);
}

.license-card {
    background: var(--smf-surface);
    border: 1px solid var(--smf-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.license-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--smf-accent);
    background: var(--smf-accent-light);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
}

.license-badge {
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-active {
    background: #ecfdf5;
    color: var(--smf-success);
}

.badge-expired {
    background: #fef2f2;
    color: var(--smf-danger);
}

/* ===== Footer ===== */
.smf-footer {
    border-top: 1px solid var(--smf-border);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--smf-text-dim);
    font-size: 0.85rem;
    background: var(--smf-bg-alt);
}

.smf-footer a {
    color: var(--smf-text-muted);
    text-decoration: none;
}

.smf-footer a:hover {
    color: var(--smf-accent);
}

/* ===== Utilities ===== */
.container-smf {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .smf-navbar {
        padding: 0 1rem;
    }

    .nav-hamburger {
        display: flex;
    }

    .smf-nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--smf-bg);
        border-bottom: 1px solid var(--smf-border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        padding: 0.75rem 0;
        gap: 0;
        z-index: 999;
    }

    .nav-toggle:checked ~ .smf-nav-links {
        display: flex;
    }

    .smf-nav-links li {
        width: 100%;
    }

    .smf-nav-links a:not(.btn-smf) {
        display: block;
        padding: 0.85rem 1.25rem;
        border-radius: 0;
        font-size: 1rem;
        color: var(--smf-text);
    }

    .smf-nav-links a:not(.btn-smf):hover,
    .smf-nav-links a:not(.btn-smf).active {
        background: var(--smf-surface-2);
        color: var(--smf-accent);
    }

    .smf-nav-links .btn-smf {
        display: block;
        width: calc(100% - 2.5rem);
        margin: 0.35rem 1.25rem;
        text-align: center;
    }

    .smf-nav-links .btn-smf-primary {
        margin-top: 0.5rem;
    }

    .smf-nav-links .lang-dropdown {
        padding: 0.75rem 1.25rem;
        width: 100%;
        border-top: 1px solid var(--smf-border);
        margin-top: 0.25rem;
    }

    .smf-nav-links .lang-dropdown > summary {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.95rem;
        justify-content: center;
    }

    .smf-nav-links .lang-menu {
        position: static;
        box-shadow: none;
        margin-top: 0.25rem;
    }

    .hero { padding: 3rem 1.25rem 2.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1rem; }

    .features-section { padding: 3rem 1rem; }
    .section-header h2 { font-size: 1.5rem; }

    .industries-section { padding: 3rem 1rem; }
    .industries-grid { grid-template-columns: 1fr; gap: 1rem; }
    .industry-card { padding: 1.25rem; gap: 0.85rem; }
    .industry-icon { width: 52px; height: 52px; font-size: 2rem; border-radius: 10px; }

    .pricing-section { padding: 3rem 1rem; }

    .auth-card { padding: 1.75rem; }

    .dashboard { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.4rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn-smf { width: 100%; }
}

/* ===== Override bootstrap ===== */
a { color: var(--smf-accent); }
a:hover { color: var(--smf-accent-hover); }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--smf-success);
}

.invalid {
    outline: 1px solid var(--smf-danger);
}

.validation-message {
    color: var(--smf-danger);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.blazor-error-boundary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    color: var(--smf-danger);
    border-radius: var(--radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    display: none;
    background: var(--smf-surface);
    border: 1px solid var(--smf-danger);
    color: var(--smf-text);
    padding: 1rem;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius);
    z-index: 9999;
}
