/*
Theme Name:  FinalEasy
Theme URI:   https://finaleasy.com
Description: Thème officiel FinalEasy — Site marketing + Portail client B2B
Author:      FinalEasy
Version:     1.0.0
License:     GPL v2 or later
Text Domain: finaleasy-theme
*/

/* =====================================================================
   RESET & BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:        #1e5ac8;
    --blue-dark:   #1648a0;
    --blue-xdark:  #0f3070;
    --blue-light:  #e8effe;
    --blue-pale:   #f0f4ff;
    --green:       #16a34a;
    --red:         #dc2626;
    --orange:      #f59e0b;
    --gray-50:     #f9fafb;
    --gray-100:    #f3f4f6;
    --gray-200:    #e5e7eb;
    --gray-400:    #9ca3af;
    --gray-500:    #6b7280;
    --gray-700:    #374151;
    --gray-900:    #111827;
    --white:       #ffffff;
    --radius-sm:   6px;
    --radius:      12px;
    --radius-lg:   20px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
    --shadow:      0 4px 20px rgba(30,90,200,.10);
    --shadow-lg:   0 12px 40px rgba(30,90,200,.18);
    --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --transition:  .25s ease;
}

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }

body {
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); }
ul, ol { list-style: none; }

/* =====================================================================
   TYPOGRAPHY
   ===================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p  { line-height: 1.7; }

.text-lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray-500);
    line-height: 1.7;
}

/* =====================================================================
   LAYOUT
   ===================================================================== */
.fe-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}
.fe-section {
    padding: clamp(60px, 8vw, 100px) 0;
}
.fe-section-sm { padding: 48px 0; }

.fe-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.fe-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.fe-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
    .fe-grid-2, .fe-grid-3 { grid-template-columns: 1fr; }
    .fe-phone-mock { display: none; }
    .fe-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .fe-grid-4 { grid-template-columns: 1fr; }
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.fe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.fe-btn-primary {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}
.fe-btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30,90,200,.3);
}
.fe-btn-outline {
    background: transparent;
    color: var(--blue);
    border-color: var(--blue);
}
.fe-btn-outline:hover {
    background: var(--blue-light);
}
.fe-btn-white {
    background: var(--white);
    color: var(--blue);
    border-color: var(--white);
}
.fe-btn-white:hover {
    background: var(--blue-light);
    color: var(--blue-dark);
}
.fe-btn-lg {
    padding: 16px 32px;
    font-size: 17px;
    border-radius: 8px;
}
.fe-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* =====================================================================
   BADGE / PILL
   ===================================================================== */
.fe-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.fe-badge-blue   { background: var(--blue-light); color: var(--blue); }
.fe-badge-green  { background: #dcfce7; color: var(--green); }
.fe-badge-orange { background: #fef3c7; color: #92400e; }

/* =====================================================================
   CARDS
   ===================================================================== */
.fe-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.fe-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.fe-card-icon {
    width: 52px;
    height: 52px;
    background: var(--blue-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.fe-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.fe-card p  { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* =====================================================================
   SECTION HEADERS
   ===================================================================== */
.fe-section-header {
    text-align: center;
    margin-bottom: clamp(40px, 5vw, 64px);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.fe-section-header .fe-badge { margin-bottom: 14px; }
.fe-section-header p { margin-top: 14px; font-size: 1.1rem; color: var(--gray-500); }

/* =====================================================================
   FORMS (frontend portal)
   ===================================================================== */
.fe-form-group { margin-bottom: 20px; }
.fe-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
}
.fe-form-group input,
.fe-form-group select,
.fe-form-group textarea {
    width: 100%;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.fe-form-group input:focus,
.fe-form-group textarea:focus,
.fe-form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(30,90,200,.10);
}
.fe-form-group textarea { resize: vertical; min-height: 110px; }

/* =====================================================================
   ALERTS
   ===================================================================== */
.fe-alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.fe-alert-success { background: #f0fdf4; border-left: 4px solid var(--green);  color: #166534; }
.fe-alert-error   { background: #fef2f2; border-left: 4px solid var(--red);    color: #991b1b; }
.fe-alert-warning { background: #fff7ed; border-left: 4px solid var(--orange); color: #9a3412; }
.fe-alert-info    { background: var(--blue-pale); border-left: 4px solid var(--blue); color: var(--blue-dark); }

/* =====================================================================
   NAVIGATION
   ===================================================================== */
.fe-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
}
.fe-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.08); }

.fe-nav-inner {
    display: flex;
    align-items: center;
    height: 68px;
    gap: 32px;
}
.fe-nav-logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--blue);
    letter-spacing: -.04em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.fe-nav-logo .logo-dot { color: var(--orange); }

.fe-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.fe-nav-links a {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: background var(--transition), color var(--transition);
}
.fe-nav-links a:hover { background: var(--blue-pale); color: var(--blue); }
.fe-nav-links a.active { color: var(--blue); font-weight: 700; }

.fe-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.fe-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-700);
    padding: 4px;
    margin-left: auto;
}

@media (max-width: 820px) {
    .fe-nav-links { display: none; }
    .fe-nav-toggle { display: block; }
    .fe-nav-inner { gap: 16px; }
    .fe-nav-actions .fe-btn-outline { font-size: 12px; padding: 6px 10px; }
    .fe-nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        padding: 16px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(0,0,0,.08);
    }
}

/* =====================================================================
   HERO
   ===================================================================== */
.fe-hero {
    padding-top: calc(68px + 60px);
    padding-bottom: 80px;
    background: linear-gradient(160deg, var(--blue-xdark) 0%, var(--blue) 50%, #4f7fe8 100%);
    position: relative;
    overflow: hidden;
}
.fe-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.fe-hero-inner { position: relative; z-index: 1; }
.fe-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.9);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}
.fe-hero h1 {
    color: var(--white);
    margin-bottom: 20px;
    max-width: 700px;
}
.fe-hero h1 em { font-style: normal; color: var(--orange); }
.fe-hero .text-lead { color: rgba(255,255,255,.8); margin-bottom: 36px; max-width: 560px; }

.fe-hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 48px; }

.fe-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 36px;
}
.fe-hero-stat-value { font-size: 2rem; font-weight: 900; color: var(--white); display: block; }
.fe-hero-stat-label { font-size: 13px; color: rgba(255,255,255,.65); }

/* =====================================================================
   MOCKUP PHONE
   ===================================================================== */
.fe-phone-mock {
    background: #1a1a2e;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    max-width: 280px;
    margin: 0 auto;
}
.fe-phone-screen {
    background: var(--blue-pale);
    border-radius: 26px;
    overflow: hidden;
    font-size: 12px;
}
.fe-phone-bar {
    background: var(--blue);
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 13px;
}
.fe-phone-body { padding: 16px; }
.fe-phone-field { background: #fff; border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 11px; color: var(--gray-500); }
.fe-phone-field strong { display: block; color: var(--gray-700); font-size: 11px; margin-bottom: 3px; }
.fe-phone-btn { background: var(--blue); color: #fff; border-radius: 8px; padding: 10px; text-align: center; font-weight: 700; font-size: 12px; margin-top: 12px; }

/* =====================================================================
   HOW IT WORKS — STEPS
   ===================================================================== */
.fe-steps { counter-reset: step; }
.fe-step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 0;
    border-bottom: 1px solid var(--gray-200);
}
.fe-step:last-child { border-bottom: none; }
.fe-step-num {
    counter-increment: step;
    width: 48px;
    height: 48px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}
.fe-step-content h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--gray-900); }
.fe-step-content p  { font-size: 14px; color: var(--gray-500); }

/* =====================================================================
   PRICING CARD
   ===================================================================== */
.fe-price-card {
    background: var(--white);
    border: 2px solid var(--blue);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.fe-price-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: var(--blue-pale);
    border-radius: 50%;
}
.fe-price-popular {
    position: absolute;
    top: 20px; right: -30px;
    background: var(--orange);
    color: var(--white);
    padding: 4px 40px;
    font-size: 12px;
    font-weight: 700;
    transform: rotate(30deg);
}
.fe-price-amount {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--blue);
    line-height: 1;
    margin: 16px 0 8px;
}
.fe-price-amount sup { font-size: 1.5rem; vertical-align: top; margin-top: 12px; margin-right: 4px; }
.fe-price-amount span { font-size: 1rem; font-weight: 400; color: var(--gray-500); }
.fe-price-features { margin: 24px 0 32px; }
.fe-price-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 15px;
}
.fe-price-feature:last-child { border-bottom: none; }
.fe-check { color: var(--green); font-size: 18px; flex-shrink: 0; }

/* =====================================================================
   PORTAL (frontend client)
   ===================================================================== */
.fe-portal-wrap { padding-top: calc(68px + 32px); min-height: 100vh; background: var(--blue-pale); }
.fe-portal-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - 68px);
}
.fe-portal-sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 24px 0;
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
}
.fe-sidebar-user { padding: 0 20px 20px; border-bottom: 1px solid var(--gray-200); margin-bottom: 12px; }
.fe-sidebar-avatar {
    width: 44px; height: 44px;
    background: var(--blue);
    border-radius: 50%;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    margin-bottom: 10px;
}
.fe-sidebar-name { font-weight: 700; font-size: 14px; color: var(--gray-900); }
.fe-sidebar-role { font-size: 12px; color: var(--gray-400); }
.fe-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    border-left: 3px solid transparent;
    transition: all var(--transition);
}
.fe-sidebar-nav a:hover { background: var(--blue-pale); color: var(--blue); }
.fe-sidebar-nav a.active { background: var(--blue-pale); color: var(--blue); border-left-color: var(--blue); font-weight: 700; }
.fe-sidebar-nav .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.fe-portal-main { padding: 32px; }
.fe-portal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.fe-portal-header h1 { font-size: 1.6rem; }

/* Portal cards */
.fe-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.fe-stat-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.fe-stat-card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); font-weight: 700; margin-bottom: 8px; }
.fe-stat-card-value { font-size: 2.2rem; font-weight: 900; color: var(--blue); }
.fe-stat-card-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* Portal table */
.fe-portal-table-wrap { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.fe-portal-table-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.fe-portal-table-header h2 { font-size: 15px; }
.fe-portal-table { border-collapse: collapse; width: 100%; }
.fe-portal-table th { background: var(--gray-50); padding: 10px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); font-weight: 700; border-bottom: 1px solid var(--gray-200); }
.fe-portal-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; vertical-align: middle; }
.fe-portal-table tr:last-child td { border-bottom: none; }
.fe-portal-table tr:hover td { background: var(--blue-pale); }
.fe-portal-table .fe-empty { text-align: center; padding: 40px; color: var(--gray-400); font-style: italic; }

/* Progress bar */
.fe-progress { background: var(--gray-200); border-radius: 20px; height: 8px; overflow: hidden; margin: 6px 0 4px; }
.fe-progress-fill { height: 100%; border-radius: 20px; background: var(--blue); transition: width .4s; }
.fe-progress-fill.warn { background: var(--orange); }
.fe-progress-fill.danger { background: var(--red); }

/* URL copy */
.fe-copy-group { display: flex; gap: 6px; }
.fe-copy-group input { font-size: 12px; color: var(--gray-500); background: var(--gray-50); }

@media (max-width: 768px) {
    .fe-portal-grid { grid-template-columns: 1fr; }
    .fe-portal-sidebar { position: static; height: auto; }
    .fe-portal-main { padding: 20px 16px; }
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.fe-footer {
    background: var(--gray-900);
    color: rgba(255,255,255,.65);
    padding: 64px 0 32px;
}
.fe-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.fe-footer-brand .logo { font-size: 24px; font-weight: 900; color: var(--white); letter-spacing: -.04em; margin-bottom: 14px; }
.fe-footer-brand .logo .dot { color: var(--orange); }
.fe-footer-brand p { font-size: 14px; line-height: 1.7; max-width: 280px; }
.fe-footer h4 { color: var(--white); font-size: 14px; margin-bottom: 16px; }
.fe-footer ul li { margin-bottom: 10px; }
.fe-footer ul li a { color: rgba(255,255,255,.55); font-size: 14px; }
.fe-footer ul li a:hover { color: var(--white); }
.fe-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}
@media (max-width: 768px) {
    .fe-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 480px) {
    .fe-footer-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   MISC
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Pricing grid responsive */
@media (max-width: 820px) {
    .fe-pricing-grid {
        grid-template-columns: 1fr !important;
        max-width: 420px !important;
    }
}
@media (min-width: 821px) and (max-width: 1000px) {
    .fe-pricing-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}
