/* ============================================================================
 * PHOTO NEUVE — SHARED STYLESHEET (style.css)
 * ============================================================================
 * This stylesheet styles:
 *   1. The main application page (/index.html)
 *   2. The SEO guide pages (/articles/*.html)
 *   3. The legal compliance pages (/conformity/*.html)
 *
 * Structure:
 *   - Theme design tokens (:root CSS variables)
 *   - Global reset & [hidden] safety rule
 *   - Top navigation bar & hero header
 *   - Pro success banner & device sharing card
 *   - Buttons (primary, secondary, banner actions)
 *   - File/folder picker card
 *   - Live progress bar & completion summary
 *   - Pricing card & manual activation code input
 *   - "How it works" & FAQ cards
 *   - Reusable modal popup & floating "Back to top" button
 *   - Footer & shared article/legal page layouts
 *   - Mobile responsive rules (@media max-width: 680px)
 * ========================================================================== */

/* ----------------------------------------------------------------------------
 * 1. DESIGN TOKENS (CSS Custom Properties)
 * Centralizing colors, corner roundness, and fonts here makes it easy to
 * tweak the visual theme in one place using var(--name).
 * -------------------------------------------------------------------------- */
:root {
  --bg: #f8fafc;             /* Soft cool light-gray page canvas */
  --surface: #fff;           /* Pure white for elevated cards and modals */
  --surface-elev: #f1f5f9;   /* Slightly darker gray for inset boxes & progress track */
  --text-primary: #0f172a;   /* Near-black ink for headings and main text */
  --text-secondary: #334155; /* Charcoal gray for body copy */
  --text-muted: #64748b;     /* Lighter slate gray for captions and legal notes */
  --border: #e2e8f0;         /* Subtle hairline border color */
  --border-hover: #cbd5e1;   /* Slightly stronger border for inputs/hover states */
  --primary: #0d9488;        /* Brand teal for primary buttons and links */
  --primary-hover: #0f766e;  /* Darker teal on mouse hover */
  --green: #059669;          /* Emerald green for "success / Pro active" badges */
  --green-bg: #ecfdf5;       /* Soft mint background for Pro banners */
  --radius-sm: 8px;          /* Small rounded corners (inputs, small buttons) */
  --radius-md: 12px;         /* Medium rounded corners (cards, main CTA) */
  --radius-lg: 16px;         /* Large rounded corners (outer container cards) */
  --radius-full: 9999px;     /* Pill / circle shape (badges, progress bar) */
  --font-mono: "SF Mono", Menlo, Consolas, monospace; /* Fixed-width font for file paths & codes */
}

/* ----------------------------------------------------------------------------
 * 2. GLOBAL RESET & BASE TYPOGRAPHY
 * -------------------------------------------------------------------------- */

/* Make width/height include padding and borders, and remove default browser margins */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*
 * CRITICAL: Forces HTML `hidden` attributes to always hide elements, even if a
 * CSS class sets `display: flex` or `display: inline-flex` on the same element.
 * Without `!important`, classes like `.app-modal { display: flex }` would override
 * `<div id="appModal" hidden>` and keep the modal stuck open on screen.
 */
[hidden] {
  display: none !important;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  /* Uses the visitor's native OS font (San Francisco on Apple, Segoe UI on Windows, Roboto on Android) for zero font-download delay */
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 4rem;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

/* ----------------------------------------------------------------------------
 * 3. TOP NAVIGATION BAR & HERO HEADER
 * -------------------------------------------------------------------------- */
.navbar {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}

/* Pill badge displayed in the header and pricing card when Pass Illimité is unlocked */
.badge-pro-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.hero {
  max-width: 760px;
  margin: 1rem auto 1.5rem;
  text-align: center;
  padding: 0 1rem;
}

.hero-title {
  /* Scales smoothly between 1.45rem (mobile) and 2.1rem (desktop) */
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 580px;
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.65rem;
}

/* Centers the main tool and content column */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Reusable white card shell used for the picker and progress workspace */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  padding: 2rem 1.5rem;
}

/* ----------------------------------------------------------------------------
 * 4. PASS PRO SUCCESS BANNER & MULTI-DEVICE SHARE BOX
 * -------------------------------------------------------------------------- */
.pro-success-banner {
  max-width: 680px;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--green-bg);
  border: 1px solid #6ee7b7;
  border-radius: var(--radius-md);
}

/* Stacks text above buttons on mobile, switches to side-by-side at >= 600px */
.pro-success-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .pro-success-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.pro-success-text strong {
  display: block;
  font-size: 1rem;
  color: #065f46;
  margin-bottom: 0.25rem;
}

.pro-banner-lead,
.pro-banner-code-label {
  display: block;
  color: #047857;
}

.pro-banner-lead {
  font-size: 0.88rem;
  font-weight: 600;
}

.pro-banner-code-label {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Styles the monospace box showing the user's activation code / Stripe session ID */
.pro-banner-sub code,
.pro-share-code-row code {
  font-family: var(--font-mono);
  font-weight: 600;
  background: #fff;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid #a7f3d0;
  color: #064e3b;
  display: block;
  margin-top: 0.35rem;
  /* Prevents long Stripe session IDs from overflowing narrow mobile screens */
  word-break: break-all;
  font-size: 0.82rem;
}

.pro-banner-actions,
.pro-share-actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pro-share-box {
  margin-top: 1.25rem;
  padding: 1.15rem;
  background: var(--green-bg);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  text-align: left;
}

.pro-share-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.35rem;
}

.pro-share-desc {
  font-size: 0.85rem;
  color: #047857;
  margin-bottom: 0.75rem;
}

/* ----------------------------------------------------------------------------
 * 5. BUTTONS
 * -------------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.95rem 2.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-banner-copy,
.btn-banner-share,
.btn-copy-code,
.btn-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-banner-copy,
.btn-copy-code {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-banner-copy:hover,
.btn-copy-code:hover {
  background: var(--primary-hover);
}

.btn-banner-share,
.btn-share-link {
  background: #fff;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.btn-banner-share:hover,
.btn-share-link:hover {
  background: #ecfdf5;
}

/* ----------------------------------------------------------------------------
 * 6. FILE / FOLDER PICKER CARD
 * -------------------------------------------------------------------------- */
.picker-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.picker-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.drop-hint {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-weight: 500;
}

.sub-pick-container {
  margin-top: 0.35rem;
}

/* Text-link styled <button> inside the picker card */
.sub-pick-link {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sub-pick-link:hover {
  color: var(--primary);
}

/* ----------------------------------------------------------------------------
 * 7. PROCESSING PROGRESS BAR & COMPLETION SUMMARY
 * -------------------------------------------------------------------------- */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.progress-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.progress-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-elev);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* Truncates long nested folder paths with "..." on a single line */
.progress-filename {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.done-view {
  text-align: center;
  padding: 1.25rem 0;
}

.done-icon {
  width: 56px;
  height: 56px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.done-icon svg {
  width: 32px;
  height: 32px;
}

.done-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.done-summary {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.done-destination {
  font-size: 0.95rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.done-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
}

/* ----------------------------------------------------------------------------
 * 8. PRICING CARD & MANUAL PASS ACTIVATION
 * -------------------------------------------------------------------------- */
.pricing-section {
  max-width: 580px;
  margin: 0.5rem auto 0;
}

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

.section-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  box-shadow: 0 8px 24px -4px rgba(13, 148, 136, 0.15);
  display: flex;
  flex-direction: column;
}

.plan-name {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.plan-price {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.65rem;
}

.plan-features {
  list-style: none;
  margin-bottom: 1.75rem;
}

.plan-features li {
  font-size: 0.92rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.plan-features li:last-child {
  border-bottom: none;
}

.pricing-stripe-box {
  text-align: center;
}

.plan-terms-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.4;
}

.activation-section {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.activation-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.activation-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.code-input-group {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  width: 100%;
  margin: 0.75rem auto 0;
}

.code-input-group input {
  flex: 1;
  /* `min-width: 0` lets the flex input shrink properly inside narrow mobile containers */
  min-width: 0;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.code-input-group input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.code-input-group button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
}

.code-input-group button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.code-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ----------------------------------------------------------------------------
 * 9. "HOW IT WORKS" & FAQ SECTIONS
 * -------------------------------------------------------------------------- */
.tech-section,
.faq-section {
  max-width: 820px;
  margin: 4rem auto 0;
}

/* Responsive 2-column grid on desktop, automatically wraps to 1 column on narrow screens */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tech-card,
.faq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.tech-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tech-card-icon {
  width: 32px;
  height: 32px;
  background: #ccfbf1;
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tech-card p,
.faq-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* ----------------------------------------------------------------------------
 * 10. IN-APP MODAL DIALOG & FLOATING "BACK TO TOP" BUTTON
 * -------------------------------------------------------------------------- */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  max-width: 460px;
  width: 100%;
  padding: 1.75rem 1.5rem;
  z-index: 1001;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.modal-message {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  /* Preserves `\n\n` line breaks inside JS message strings */
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#modalConfirmBtn {
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
}

/* Hidden by default using opacity + pointer-events; JS toggles `.visible` on scroll */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ----------------------------------------------------------------------------
 * 11. FOOTER & SHARED SUB-PAGE STYLES (/articles/* & /conformity/*)
 * -------------------------------------------------------------------------- */
footer {
  max-width: 820px;
  margin: 4.5rem auto 0;
  padding: 2.5rem 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

footer p {
  margin-bottom: 0.75rem;
}

.footer-links,
.footer-articles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.footer-articles a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.footer-articles a:hover {
  text-decoration: underline;
}

.footer-rgpd {
  font-size: 0.8rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  max-width: 680px;
  margin: 1rem auto;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* Styles used by the long-form SEO articles and legal compliance pages */
.article-page {
  max-width: 760px;
  margin: 2.5rem auto 4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.article-page h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.article-page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.article-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.article-page p,
.article-page ul,
.article-page ol {
  margin-bottom: 1.15rem;
  color: var(--text-secondary);
}

.article-page ul,
.article-page ol {
  margin-left: 1.5rem;
}

.article-page li {
  margin-bottom: 0.35rem;
}

.breadcrumb,
.meta-info,
.last-update {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.highlight-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.alert-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.legal-section {
  font-size: 0.92rem;
  background: var(--surface-elev);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.cta-banner {
  background: #f0fdfa;
  border: 2px solid #99f6e4;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  margin: 2rem 0;
}

.btn-cta {
  display: inline-block;
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
}

/* ----------------------------------------------------------------------------
 * 12. RESPONSIVE BREAKPOINT (Mobile screens <= 680px)
 * -------------------------------------------------------------------------- */

/* On desktop, hide mobile-only labels/icons */
.mobile-only {
  display: none !important;
}

@media (max-width: 680px) {
  /* Flip visibility: hide desktop folder wording, show mobile photo wording */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .card,
  .article-page {
    padding: 1.5rem 1.15rem;
  }

  /* Make buttons and activation form inputs full-width for easier thumb tapping */
  .btn-primary,
  .done-actions button,
  .code-input-group,
  .code-input-group input,
  .code-input-group button {
    width: 100%;
  }

  .code-input-group {
    flex-direction: column;
  }
}
