/* ============================================
   SecureLink — Alpes Conseil Informatique
   Design Premium / style.css
   ============================ */

/* ── Variables de la charte graphique ────────────────────────
   Remplacez ces valeurs par les couleurs officielles
   d'Alpes Conseil Informatique.
   ─────────────────────────────────────────────────────────── */
:root {
    /* Couleurs principales (À PERSONNALISER) */
    --color-primary:       #2563eb;
    --color-primary-dark:  #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-accent:        #60a5fa;

    /* Arrière-plan (dark premium) */
    --bg-page-start: #070e1f;
    --bg-page-end:   #0d1b35;

    /* Carte glassmorphism */
    --bg-card:        rgba(255, 255, 255, 0.045);
    --bg-card-hover:  rgba(255, 255, 255, 0.06);
    --bg-input:       rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.09);
    --bg-tab-active:  rgba(37, 99, 235, 0.12);
    --bg-btn-ghost:   rgba(255, 255, 255, 0.06);
    --bg-btn-ghost-hover: rgba(255, 255, 255, 0.1);

    /* Textes */
    --text-primary:   #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;

    /* Bordures */
    --border:        rgba(255, 255, 255, 0.08);
    --border-focus:  rgba(37, 99, 235, 0.55);
    --border-error:  rgba(239, 68, 68, 0.5);
    --border-success: rgba(16, 185, 129, 0.5);

    /* Ombres */
    --shadow-card: 0 32px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
    --shadow-btn:  0 8px 24px rgba(37, 99, 235, 0.35);
    --shadow-btn-hover: 0 14px 36px rgba(37, 99, 235, 0.55);

    /* Rayons */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  24px;
    --radius-2xl: 32px;

    /* Transitions */
    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration:      0.25s;
    --duration-slow: 0.4s;

    /* Dimensions */
    --card-max-width: 680px;
    --header-height:  64px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* ── Base ────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-page-start) 0%, var(--bg-page-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Particules de fond ──────────────────────────────────────── */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

.particle:nth-child(1) { left: 15%; animation-duration: 20s; animation-delay: 0s;   width: 3px; height: 3px; }
.particle:nth-child(2) { left: 35%; animation-duration: 28s; animation-delay: -8s;  }
.particle:nth-child(3) { left: 55%; animation-duration: 22s; animation-delay: -4s;  width: 3px; height: 3px; }
.particle:nth-child(4) { left: 72%; animation-duration: 32s; animation-delay: -12s; }
.particle:nth-child(5) { left: 88%; animation-duration: 18s; animation-delay: -6s;  width: 4px; height: 4px; }

@keyframes float-particle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    5%   { opacity: 0.4; }
    95%  { opacity: 0.15; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(7, 14, 31, 0.8);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity var(--duration) var(--ease);
}
.logo-link:hover { opacity: 0.8; }

/* Logo image — remplacez assets/img/logo.png par votre fichier */
.logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
}

/* Fallback si le logo est absent */
.logo-fallback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon { font-size: 1.5rem; }
.logo-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.badge-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 6px #10b981; }
    50%       { box-shadow: 0 0 12px #10b981, 0 0 4px #10b981; }
}

/* Bouton "Nouveau lien" (page view) */
.btn-new-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}
.btn-new-link:hover {
    color: var(--text-primary);
    background: var(--bg-btn-ghost-hover);
    border-color: rgba(255,255,255,0.15);
}

/* ── Layout principal ────────────────────────────────────────── */
.main-content {
    position: relative;
    z-index: 1;
    max-width: var(--card-max-width);
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fade-up 0.6s var(--ease) both;
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 30%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto 1.25rem;
    line-height: 1.7;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.info-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
}

/* ── Carte glassmorphism ──────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    animation: fade-up 0.6s var(--ease) 0.1s both;
}

.main-card { overflow: hidden; }

/* ── Système d'onglets ────────────────────────────────────────── */
.tabs {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.75rem;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Indicateur glissant sous l'onglet actif */
.tab-indicator {
    position: absolute;
    bottom: 4px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 1px;
    transition: left var(--duration) var(--ease), width var(--duration) var(--ease);
}

/* ── Panneaux d'onglets ───────────────────────────────────────── */
.tab-pane {
    display: none;
    animation: fade-in 0.2s var(--ease) both;
}
.tab-pane.active { display: block; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Labels de champs ────────────────────────────────────────── */
.field-group { margin-bottom: 1.25rem; }

.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.label-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ── Textarea ────────────────────────────────────────────────── */
.textarea-wrapper {
    position: relative;
}

.textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 180px;
    transition: border-color var(--duration) var(--ease),
                background  var(--duration) var(--ease),
                box-shadow  var(--duration) var(--ease);
    outline: none;
}

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

.textarea:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.textarea-overlay {
    position: absolute;
    bottom: 0.6rem;
    right: 0.75rem;
    pointer-events: none;
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Zone de dépôt (Drag & Drop) ─────────────────────────────── */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: var(--bg-input);
    position: relative;
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--color-primary-light);
    background: var(--bg-input-focus);
    outline: none;
}

.dropzone.dragover {
    border-color: var(--color-primary);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    transform: scale(1.01);
}

.dropzone.has-file {
    border-style: solid;
    border-color: var(--border-success);
    background: rgba(16, 185, 129, 0.05);
    padding: 1rem 1.5rem;
}

.dropzone-icon {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    transition: transform var(--duration) var(--ease), color var(--duration) var(--ease);
}
.dropzone:hover .dropzone-icon { color: var(--color-accent); transform: translateY(-4px); }
.dropzone.has-file .dropzone-icon { display: none; }

.dropzone-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.dropzone.has-file .dropzone-text { display: none; }

.dropzone-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.dropzone.has-file .dropzone-subtext { display: none; }

.dropzone-link {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Input fichier caché (déclenché par clic sur la zone) */
.file-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* ── Aperçu du fichier sélectionné ───────────────────────────── */
.file-preview { margin-top: 0.75rem; }
.file-preview.hidden { display: none; }

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid var(--border-success);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    animation: fade-in 0.2s var(--ease) both;
}

.file-icon { font-size: 1.5rem; flex-shrink: 0; }

.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.remove-file {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #f87171;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--duration) var(--ease);
}
.remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* ── Sélecteur de durée ───────────────────────────────────────── */
.duration-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.duration-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.duration-buttons {
    display: flex;
    gap: 0.4rem;
    background: rgba(0,0,0,0.2);
    padding: 3px;
    border-radius: 999px;
}

.duration-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    letter-spacing: 0.01em;
}

.duration-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.duration-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
/* ── Champ mot de passe optionnel (index) ────────────────────── */
.password-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.password-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.875rem 3rem 0.875rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background var(--duration) var(--ease);
    box-sizing: border-box;
}

.password-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.password-toggle {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color var(--duration) var(--ease);
    border-radius: 4px;
}
.password-toggle:hover { color: var(--text-secondary); }

/* ── Prompt mot de passe (view) ──────────────────────────────── */
.state-password {
    padding: 1rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.password-prompt-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    margin: 0 auto 1.25rem;
}

.password-prompt-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.6rem;
}

.password-prompt-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto 1.5rem;
}

.password-prompt-form {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-align: left;
}

.pwd-error {
    font-size: 0.82rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--border-error);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.875rem;
    text-align: left;
}


/* ── Section action (bouton créer) ───────────────────────────── */
.action-section { position: relative; }

/* Message d'erreur */
.error-msg {
    font-size: 0.82rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.875rem;
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--duration) var(--ease);
}
.error-msg.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Bouton Créer ────────────────────────────────────────────── */
.btn-create {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    background-size: 200% 200%;
    background-position: 100% 50%;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background-position 0.4s var(--ease);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

/* Shimmer sur hover */
.btn-create::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s var(--ease);
}

.btn-create:hover::before { transform: translateX(100%); }

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
    background-position: 0% 50%;
}

.btn-create:active { transform: translateY(0) scale(0.99); }

.btn-create:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Icône et texte du bouton */
.btn-create-icon { flex-shrink: 0; display: flex; }

.btn-create-text {
    transition: opacity var(--duration-fast) var(--ease);
}

/* Spinner de chargement */
.btn-create-spinner {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-create.loading .btn-create-icon,
.btn-create.loading .btn-create-text {
    opacity: 0;
}
.btn-create.loading .btn-create-spinner { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Section résultat ────────────────────────────────────────── */
.result-section {
    margin-top: 1.5rem;
    animation: slide-down 0.35s var(--ease-bounce) both;
}
.result-section.hidden { display: none; }

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.result-divider::before,
.result-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.result-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.result-icon {
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    flex-shrink: 0;
}

.result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 2px;
}

.result-expires {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.result-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.result-link-input {
    width: 100%;
    flex: none;
    padding: 0.65rem 0.875rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    cursor: text;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-link-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* Bouton Copier */
.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}
.btn-copy:hover {
    background: var(--bg-btn-ghost-hover);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.btn-copy.copied {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.result-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Grille de fonctionnalités ───────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.75rem;
    animation: fade-up 0.6s var(--ease) 0.25s both;
}

.feature-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.feature-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.14);
}

.feature-icon { font-size: 1.75rem; margin-bottom: 0.6rem; }

.feature-item h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-item p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}
.site-footer strong { color: var(--text-secondary); }

/* ── Page view — spécifique ──────────────────────────────────── */
.view-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 80px);
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.view-card {
    width: 100%;
    max-width: var(--card-max-width);
}

/* ── États : Chargement, Contenu, Erreur ─────────────────────── */
.state-loading,
.state-content,
.state-error {
    padding: 1rem 0;
    text-align: center;
}

.state-content { text-align: left; }

.hidden { display: none !important; }

/* Spinner de chargement */
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--color-primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}

.loading-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.loading-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* État erreur */
.error-icon {
    color: #f87171;
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
}

.error-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.error-message {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto;
}

/* ── Contenu déchiffré — Message texte ───────────────────────── */
.secret-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.secret-type-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.secret-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    min-height: 80px;
    margin-bottom: 1.25rem;
}

.secret-actions { display: flex; gap: 0.5rem; }

.btn-copy-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.btn-copy-text:hover {
    color: var(--text-primary);
    background: var(--bg-btn-ghost-hover);
}
.btn-copy-text.copied {
    color: #34d399;
    border-color: rgba(16,185,129,0.3);
}

/* ── Contenu déchiffré — Fichier ─────────────────────────────── */
.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem 1.5rem;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
}

.file-icon-large { font-size: 3.5rem; }

.file-info-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name-view {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-size-view {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-btn);
    transition: all var(--duration) var(--ease);
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
}

/* ── Animations globales ──────────────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tremblement (validation) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}
.shake { animation: shake 0.5s var(--ease) both; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .main-content { padding: 1.75rem 1rem 4rem; }
    .hero { margin-bottom: 1.75rem; }
    .card { padding: 1.25rem; border-radius: var(--radius-lg); }

    .features-grid { grid-template-columns: 1fr; gap: 0.75rem; }

    .duration-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-copy { width: 100%; justify-content: center; }

    .header-badge { display: none; }
}

@media (max-width: 400px) {
    .tab-btn { font-size: 0.8rem; padding: 0.55rem 0.75rem; }
    .duration-buttons { width: 100%; justify-content: space-between; }
    .duration-btn { flex: 1; text-align: center; padding: 0.35rem 0.5rem; }
}

/* ── Modale QR Code ──────────────────────────────────────────── */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-modal.hidden { display: none; }

.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qr-modal-box {
    position: relative;
    z-index: 1;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fade-up 0.2s var(--ease) both;
}

.qr-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: color var(--duration) var(--ease);
    line-height: 1;
}
.qr-modal-close:hover { color: var(--text-primary); }

.qr-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.qr-modal-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 240px;
    line-height: 1.5;
    margin: 0;
}

#qr-canvas img,
#qr-canvas canvas {
    border-radius: var(--radius-md);
    display: block;
}

/* ── Thème clair ─────────────────────────────────────────────── */
body.light-theme {
    --bg-page-start:      #f0f4ff;
    --bg-page-end:        #e2eaf8;
    --bg-card:            rgba(255, 255, 255, 0.88);
    --bg-card-hover:      rgba(255, 255, 255, 0.95);
    --bg-input:           rgba(0, 0, 0, 0.05);
    --bg-input-focus:     rgba(0, 0, 0, 0.08);
    --bg-tab-active:      rgba(37, 99, 235, 0.08);
    --bg-btn-ghost:       rgba(0, 0, 0, 0.06);
    --bg-btn-ghost-hover: rgba(0, 0, 0, 0.1);
    --text-primary:       #0f172a;
    --text-secondary:     #475569;
    --text-muted:         #94a3b8;
    --border:             rgba(0, 0, 0, 0.1);
    --border-focus:       rgba(37, 99, 235, 0.5);
    --shadow-card:        0 24px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06) inset;
}
body.light-theme .site-header {
    background: rgba(240, 244, 255, 0.92);
}
body.light-theme .particle { background: var(--color-primary); }
body.light-theme .secret-text { background: rgba(0,0,0,0.04); }
body.light-theme .qr-modal-box { background: #f8fafc; }
body.light-theme .result-link-input {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
    color: #0f172a;
}

/* ── Toolbar (génération de mot de passe) ────────────────────── */
.textarea-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .6rem;
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}
.toolbar-btn:hover {
    color: var(--text-primary);
    background: var(--bg-btn-ghost-hover);
    border-color: rgba(255,255,255,0.15);
}
.toolbar-btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    border-color: transparent;
}
.toolbar-btn-primary:hover {
    color: white;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-color: transparent;
}
.gen-pwd-options {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.gen-pwd-len-label {
    font-size: .8rem;
    color: var(--text-secondary);
}

/* ── Templates de messages ───────────────────────────────────── */
.templates-section {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.templates-label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}
.templates-list {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.template-btn {
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-btn-ghost);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .25rem .7rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}
.template-btn:hover {
    border-color: var(--color-accent);
    color: var(--text-primary);
    background: var(--bg-btn-ghost-hover);
}

/* ── Bannière vues restantes (page view) ─────────────────────── */
.views-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--color-accent);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-sm);
    padding: .5rem .875rem;
    margin-bottom: 1rem;
}
.views-banner-last {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--border-error);
}

/* ── Gate de confirmation (page view) ────────────────────────── */
.state-confirm-gate {
    padding: 1rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.confirm-gate-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    margin: 0 auto 1.25rem;
}
.confirm-gate-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 .6rem;
}
.confirm-gate-sub {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto 1.5rem;
}

/* ── Barre "J'ai bien noté" ──────────────────────────────────── */
.read-confirm-bar {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.btn-read-confirm {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 500;
    color: var(--color-accent);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.btn-read-confirm:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--text-primary);
}

/* ── État "Secret lu" ────────────────────────────────────────── */
.state-read {
    padding: 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}
.state-read-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
}
.state-read-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.state-read-sub {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin: 0;
}

/* ── Zone d'impression ────────────────────────────────────────── */
#print-area { display: none; }

@media print {
    body > *:not(#print-area) { display: none !important; }
    #print-area {
        display: block !important;
        padding: 2cm;
        font-family: Arial, sans-serif;
        color: #000;
        background: #fff;
    }
    .print-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 1.5cm;
        font-size: 11pt;
        border-bottom: 1px solid #ccc;
        padding-bottom: .5cm;
    }
    .print-label  { font-size: 10pt; color: #555; margin: 0 0 .3cm; }
    .print-url {
        font-size: 9pt;
        font-family: monospace;
        word-break: break-all;
        margin: 0 0 1cm;
        border: 1px solid #ddd;
        padding: .3cm;
        border-radius: 4px;
    }
    .print-note  { font-size: 8pt; color: #888; margin-top: 1cm; font-style: italic; }
    #print-qr    { margin: .5cm 0; }
    #print-qr img, #print-qr canvas { width: 180px !important; height: 180px !important; }
}
