/* ===================================================
   SafeSend - Stylesheet principale
   Design : sobre, professionnel, confiance
   =================================================== */

:root {
    /* Palette SafeSend (extraite du logo officiel) */
    --brand: #2A5F87;          /* Bleu intermédiaire (dégradé enveloppe) */
    --brand-dark: #1A3A52;     /* Bleu marine profond ("Safe", bouclier) */
    --brand-deep: #0F2940;     /* Bleu très profond pour fonds sombres */
    --brand-light: #4A8AB5;    /* Bleu clair (touches lumineuses) */
    --accent: #14B8A6;         /* Turquoise ("Send", lignes mouvement) */
    --accent-dark: #0F9488;    /* Turquoise foncé pour hover */
    --accent-light: #5EEAD4;   /* Turquoise clair pour highlights */

    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* =============== Navigation =============== */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--brand);
    letter-spacing: -0.01em;
}

.nav-brand .lock-icon {
    width: 32px; height: 32px;
    background: var(--brand);
    color: white;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14.5px;
}
.nav-links a:hover { color: var(--brand); background: var(--surface-2); }
.nav-links a.active { color: var(--brand); background: var(--info-bg); }

.nav-cta { display: flex; gap: 10px; }

/* =============== Boutons =============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14.5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); color: white; box-shadow: var(--shadow); }
.btn-accent  { background: var(--accent); color: white; }
.btn-accent:hover  { background: var(--accent-dark); color: white; }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand); background: var(--surface-2); }
.btn-ghost   { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* =============== Alertes =============== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid;
    font-size: 14.5px;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: #065f46; }
.alert-error   { background: var(--danger-bg);  border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #92400e; }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    color: #1e40af; }

/* =============== Formulaires =============== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.form-label small { font-weight: 400; color: var(--text-muted); }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14.5px;
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 59, 92, 0.12);
}
.form-control::placeholder { color: var(--text-subtle); }
textarea.form-control { resize: vertical; min-height: 100px; font-family: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-help { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* =============== Cards =============== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.card-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* =============== Layouts app =============== */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 20px;
    font-weight: 700;
    font-size: 18px;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.active { background: var(--brand); color: white; }
.sidebar-nav a .icon { width: 18px; display: inline-flex; justify-content: center; }
.sidebar-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); padding: 18px 14px 8px; }

.main-content { padding: 32px 40px; max-width: 100%; overflow-x: hidden; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14.5px; }

/* =============== Tables =============== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfc; }

/* =============== Badges =============== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger  { background: var(--danger-bg);  color: #991b1b; }
.badge-info    { background: var(--info-bg);    color: #1e40af; }
.badge-muted   { background: var(--surface-2);  color: var(--text-muted); }

/* =============== Stats tiles =============== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; font-family: var(--font-display); }
.stat-trend { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.stat-icon { position: absolute; top: 20px; right: 20px; font-size: 24px; opacity: 0.3; }

/* =============== Folder / file icons =============== */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.folder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.folder-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand); color: inherit; }
.folder-icon { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: white; font-size: 20px; flex-shrink: 0; }
.folder-name { font-weight: 600; font-size: 15px; }
.folder-count { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* =============== Modals =============== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-close { float: right; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

/* =============== Page d'accueil / marketing =============== */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(20, 184, 166, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 780px; }
.hero-eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 52px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero h1 .highlight { color: var(--accent); font-style: italic; }
.hero p { font-size: 18px; color: rgba(255, 255, 255, 0.85); margin-bottom: 32px; line-height: 1.6; max-width: 640px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.section { padding: 80px 0; }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-eyebrow { color: var(--accent-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; margin-bottom: 12px; }
.section-title { font-family: var(--font-display); font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.section-subtitle { font-size: 17px; color: var(--text-muted); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: all .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--info-bg); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 18px; }
.feature-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-text { color: var(--text-muted); font-size: 14.5px; line-height: 1.65; }

.section-alt { background: var(--surface-2); }

.cta-band { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); color: white; padding: 72px 0; text-align: center; position: relative; }
.cta-band h2 { font-family: var(--font-display); font-size: 34px; margin-bottom: 14px; letter-spacing: -0.02em; }
.cta-band p { color: rgba(255, 255, 255, 0.85); font-size: 17px; margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

.footer { background: var(--text); color: rgba(255, 255, 255, 0.7); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.footer h4 { color: white; font-size: 14px; margin-bottom: 14px; letter-spacing: 0.02em; }
.footer a { color: rgba(255, 255, 255, 0.6); display: block; padding: 3px 0; font-size: 14px; }
.footer a:hover { color: white; }
.footer-bottom { padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; text-align: center; }

/* =============== Pricing =============== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; align-items: stretch; }
.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.pricing-card.featured { border-color: var(--brand); border-width: 2px; transform: scale(1.02); }
.pricing-card.featured::before {
    content: 'RECOMMANDÉ';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.pricing-name { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pricing-amount { font-family: var(--font-display); font-size: 40px; font-weight: 700; margin: 12px 0; letter-spacing: -0.02em; }
.pricing-amount .period { font-size: 15px; color: var(--text-muted); font-family: var(--font-sans); font-weight: 500; }
.pricing-features { list-style: none; margin: 20px 0; flex: 1; }
.pricing-features li { padding: 8px 0; font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* =============== Login pages =============== */
.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.auth-pane {
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}
.auth-visual {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(20, 184, 166, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
}
.auth-visual-content { position: relative; max-width: 440px; }
.auth-visual h2 { font-family: var(--font-display); font-size: 40px; line-height: 1.15; margin-bottom: 16px; }
.auth-visual p { font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, 0.85); }
.auth-form-wrap { max-width: 420px; width: 100%; margin: 0 auto; }
.auth-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); margin-bottom: 28px; font-size: 14.5px; }
.portal-tabs { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 24px; }
.portal-tab { flex: 1; text-align: center; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.portal-tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* =============== Responsive =============== */
@media (max-width: 960px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; }
    .sidebar-section { display: none; }
    .main-content { padding: 24px 20px; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .hero h1 { font-size: 38px; }
    .section-title { font-size: 28px; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .nav-links { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 60px 0 50px; }
}

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.4s ease-out; }

/* Share link box */
.share-result {
    background: var(--info-bg);
    border: 1px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    word-break: break-all;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 13px;
}
