/* ============================================================
   ResumeForge — Design System & Templates
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Playfair+Display:wght@400;600;700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Outfit', sans-serif;
  background: var(--rf-bg);
  color: var(--rf-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Design Tokens --- */
:root {
  --rf-bg: #0a0c14;
  --rf-bg-2: #12151f;
  --rf-bg-3: #191d2e;
  --rf-surface: rgba(255,255,255,0.04);
  --rf-surface-hover: rgba(255,255,255,0.08);
  --rf-border: rgba(255,255,255,0.1);
  --rf-border-strong: rgba(255,255,255,0.18);
  --rf-text: #e8eaf2;
  --rf-text-2: #a8b0c4;
  --rf-text-3: #6c7693;
  --rf-accent: #6366f1;
  --rf-accent-2: #a78bfa;
  --rf-accent-glow: rgba(99,102,241,0.3);
  --rf-success: #10b981;
  --rf-success-bg: rgba(16,185,129,0.15);
  --rf-danger: #ef4444;
  --rf-danger-bg: rgba(239,68,68,0.15);
  --rf-warning: #f59e0b;
  --rf-radius-sm: 8px;
  --rf-radius: 14px;
  --rf-radius-lg: 20px;
  --rf-shadow: 0 4px 30px rgba(0,0,0,0.5);
  --rf-shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --rf-transition: 0.2s ease;
}

[data-theme="light"] {
  --rf-bg: #f8fafc;
  --rf-bg-2: #ffffff;
  --rf-bg-3: #f1f5f9;
  --rf-surface: rgba(0, 0, 0, 0.04);
  --rf-surface-hover: rgba(0, 0, 0, 0.07);
  --rf-border: rgba(0, 0, 0, 0.08);
  --rf-border-strong: rgba(0, 0, 0, 0.16);
  --rf-text: #0f172a;
  --rf-text-2: #475569;
  --rf-text-3: #64748b;
  --rf-accent: #6366f1;
  --rf-accent-2: #4f46e5;
  --rf-accent-glow: rgba(99, 102, 241, 0.15);
  --rf-success: #10b981;
  --rf-success-bg: rgba(16, 185, 129, 0.12);
  --rf-danger: #ef4444;
  --rf-danger-bg: rgba(239, 68, 68, 0.12);
  --rf-warning: #d97706;
  --rf-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --rf-shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.05);
}

a { color: var(--rf-accent-2); text-decoration: none; }
a:hover { color: var(--rf-accent); }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

/* --- Utility --- */
.hidden { display: none !important; }
.logo-accent { color: var(--rf-accent-2); }

/* --- Ambient Background --- */
.rf-ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.rf-orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.25; animation: rf-orb-float 12s ease-in-out infinite;
}
.rf-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #6366f1, transparent); top: -150px; right: -100px; animation-delay: 0s; }
.rf-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #a78bfa, transparent); bottom: -100px; left: -100px; animation-delay: 4s; }
.rf-orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, #06b6d4, transparent); top: 40%; left: 40%; animation-delay: 8s; }

@keyframes rf-orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
#view-auth {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem; position: relative; z-index: 1;
}

.auth-card {
  background: rgba(18, 21, 31, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--rf-border-strong);
  border-radius: var(--rf-radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--rf-shadow), 0 0 0 1px rgba(99,102,241,0.1);
  animation: rf-card-in 0.4s ease;
}

@keyframes rf-card-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; justify-content: center;
}
.auth-logo-icon { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; display: flex; }
.auth-logo-text { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--rf-text); }

.auth-tabs {
  display: flex; background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px; padding: 4px; margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1; padding: 0.6rem; background: transparent; border: none; color: var(--rf-text-2); font-size: 0.875rem; font-weight: 500; border-radius: 7px; transition: all var(--rf-transition);
}
.auth-tab.active { background: var(--rf-accent); color: white; box-shadow: 0 2px 12px var(--rf-accent-glow); }

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.auth-subtitle { color: var(--rf-text-2); font-size: 0.875rem; margin-bottom: 0.25rem; }

.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-label { font-size: 0.8125rem; font-weight: 500; color: var(--rf-text-2); }
.field-input-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px;
  transition: border-color var(--rf-transition), box-shadow var(--rf-transition);
}
.field-input-wrap:focus-within {
  border-color: var(--rf-accent); box-shadow: 0 0 0 3px var(--rf-accent-glow);
}
.field-input-wrap.has-error {
  border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
.field-error-msg {
  color: #fca5a5; font-size: 0.78rem; margin-top: 0.25rem;
}
.field-icon { position: absolute; left: 1rem; width: 16px; height: 16px; color: var(--rf-text-3); pointer-events: none; }
.field-input {
  width: 100%; padding: 0.75rem 1rem 0.75rem 2.75rem; background: transparent; border: none; outline: none;
  color: var(--rf-text); font-size: 0.9rem;
}
.field-input::placeholder { color: var(--rf-text-3); }
.field-eye-btn {
  position: absolute; right: 0.75rem; background: none; border: none; color: var(--rf-text-3); padding: 0.25rem; display: flex; align-items: center; transition: color var(--rf-transition);
}
.field-eye-btn:hover { color: var(--rf-text); }
.field-eye-btn svg { width: 16px; height: 16px; }

.auth-error { background: var(--rf-danger-bg); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.8125rem; }
.auth-success { background: var(--rf-success-bg); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.8125rem; }

.btn-auth-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.8rem 1.5rem; background: linear-gradient(135deg, #6366f1, #a78bfa); border: none;
  border-radius: 10px; color: white; font-weight: 600; font-size: 0.9rem;
  transition: all var(--rf-transition); box-shadow: 0 4px 15px var(--rf-accent-glow);
}
.btn-auth-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--rf-accent-glow); }
.btn-auth-primary:active { transform: translateY(0); }
.btn-auth-primary svg { width: 18px; height: 18px; }

.auth-switch { text-align: center; font-size: 0.8125rem; color: var(--rf-text-2); }

/* ============================================================
   APP HEADER
   ============================================================ */
#view-app { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }

.rf-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 12, 20, 0.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rf-border);
  padding: 0 1.5rem;
  transition: background 0.3s ease;
}

[data-theme="light"] .rf-header {
  background: rgba(248, 250, 252, 0.9);
}

@media (max-width: 768px) {
  .rf-header {
    padding-top: max(env(safe-area-inset-top, 0px), 50px) !important;
  }
}
.rf-header-inner {
  max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; height: 64px;
}
.rf-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; flex-shrink: 0; }
.rf-logo-icon { width: 28px; height: 28px; border-radius: 8px; overflow: hidden; display: flex; }
.rf-logo-text { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--rf-text); }

.rf-header-nav { display: flex; align-items: center; gap: 0.75rem; flex: 1; }

#btn-new-resume,
.btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.6rem 1.25rem !important;
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
#btn-new-resume:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6) !important;
}

#btn-upload-resume,
.btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.6rem 1.25rem !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  color: #a8b0c4 !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
#btn-upload-resume:hover,
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.btn-danger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; background: var(--rf-danger-bg); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--rf-radius-sm); color: #fca5a5; font-weight: 500; font-size: 0.875rem;
  transition: all var(--rf-transition); white-space: nowrap;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-danger svg { width: 16px; height: 16px; }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; }

.rf-user-section {
  display: flex; align-items: center; gap: 0.75rem; margin-left: auto; flex-shrink: 0;
}
.rf-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; color: white;
  flex-shrink: 0;
}
.rf-user-info { display: flex; flex-direction: column; line-height: 1.3; }
.rf-user-name { font-size: 0.875rem; font-weight: 600; color: var(--rf-text); }
.rf-user-email { font-size: 0.75rem; color: var(--rf-text-3); }
.rf-user-menu-wrap { position: relative; }
.rf-user-menu-btn { background: none; border: none; color: var(--rf-text-2); display: flex; padding: 4px; transition: color var(--rf-transition); }
.rf-user-menu-btn:hover { color: var(--rf-text); }
.rf-user-menu-btn svg { width: 16px; height: 16px; }

.rf-user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--rf-bg-3);
  border: 1px solid var(--rf-border-strong); border-radius: var(--rf-radius); padding: 0.5rem;
  min-width: 180px; box-shadow: var(--rf-shadow); z-index: 200; animation: rf-dropdown-in 0.15s ease;
}
@keyframes rf-dropdown-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.rf-dropdown-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.65rem 0.75rem;
  background: none; border: none; border-radius: 8px; color: var(--rf-text-2); font-size: 0.875rem;
  transition: all var(--rf-transition); text-align: left;
}
.rf-dropdown-item:hover { background: var(--rf-surface-hover); color: var(--rf-text); }
.rf-dropdown-item.danger { color: #fca5a5; }
.rf-dropdown-item.danger:hover { background: var(--rf-danger-bg); }
.rf-dropdown-item svg { width: 15px; height: 15px; }

/* ============================================================
   TAB BAR
   ============================================================ */
.rf-tabs-bar {
  background: rgba(10, 12, 20, 0.7); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rf-border); position: sticky; top: 64px; z-index: 90;
}
.rf-tabs-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 0.25rem; position: relative;
}
.rf-tab {
  display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--rf-text-3); font-weight: 500; font-size: 0.875rem;
  transition: all var(--rf-transition); position: relative; white-space: nowrap;
}
.rf-tab:hover { color: var(--rf-text-2); }
.rf-tab.active { color: var(--rf-accent-2); border-bottom-color: var(--rf-accent); }
.rf-tab svg { width: 16px; height: 16px; }
.rf-tab-count {
  background: var(--rf-surface); border: 1px solid var(--rf-border); color: var(--rf-text-3);
  font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 20px;
}
.rf-tab.active .rf-tab-count { background: var(--rf-accent-glow); color: var(--rf-accent-2); border-color: var(--rf-accent); }

/* ============================================================
   MAIN CONTENT PANELS
   ============================================================ */
.rf-main-content { flex: 1; padding: 1.25rem 1.5rem; }
.rf-panel { max-width: 1400px; margin: 0 auto; animation: rf-panel-in 0.25s ease; }
@keyframes rf-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rf-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.rf-panel-title { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--rf-text); letter-spacing: -0.01em; }
.rf-panel-subtitle { color: var(--rf-text-2); font-size: 0.8rem; margin-top: 0.15rem; line-height: 1.4; }
.rf-panel-actions { display: flex; align-items: center; gap: 0.75rem; }

.rf-search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px;
  padding: 0.5rem 1rem; transition: border-color var(--rf-transition);
}
.rf-search-box:focus-within { border-color: var(--rf-accent); }
.rf-search-box svg { width: 15px; height: 15px; color: var(--rf-text-3); flex-shrink: 0; }
.rf-search-box input { background: none; border: none; outline: none; color: var(--rf-text); font-size: 0.875rem; width: 200px; }
.rf-search-box input::placeholder { color: var(--rf-text-3); }

/* Empty State */
.rf-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 5rem 2rem; color: var(--rf-text-2); gap: 1rem;
}
.rf-empty-icon {
  width: 80px; height: 80px; border-radius: 50%; background: var(--rf-surface); border: 1px solid var(--rf-border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem;
}
.rf-empty-icon svg { width: 36px; height: 36px; color: var(--rf-text-3); }
.rf-empty-state h3 { font-size: 1.25rem; font-weight: 600; color: var(--rf-text); }
.rf-empty-state p { max-width: 380px; font-size: 0.9rem; }

/* ============================================================
   RESUME CARDS
   ============================================================ */
.rf-resume-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem;
}

.rf-resume-card {
  background: rgba(18, 21, 31, 0.7); backdrop-filter: blur(10px);
  border: 1px solid var(--rf-border); border-radius: var(--rf-radius-lg);
  overflow: hidden; transition: all var(--rf-transition); position: relative;
  display: flex; flex-direction: column;
}
.rf-resume-card:hover { border-color: var(--rf-border-strong); transform: translateY(-3px); box-shadow: var(--rf-shadow); }
.rf-resume-card.is-primary { border-color: var(--rf-accent); box-shadow: 0 0 0 1px var(--rf-accent), 0 4px 24px var(--rf-accent-glow); }

.rf-card-template-thumb {
  height: 160px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; flex-shrink: 0;
}
.rf-card-thumb-inner {
  transform: scale(0.35); transform-origin: top center; width: 285%;
  pointer-events: none; user-select: none; position: absolute; top: 0; left: 50%; margin-left: -142.5%;
}

.rf-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }

.rf-card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.rf-card-title { font-weight: 600; font-size: 1rem; color: var(--rf-text); word-break: break-word; flex: 1; }

.rf-card-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rf-badge {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: var(--rf-surface); color: var(--rf-text-3); border: 1px solid var(--rf-border); white-space: nowrap;
}
.rf-badge.primary { background: var(--rf-accent-glow); color: var(--rf-accent-2); border-color: var(--rf-accent); }
.rf-badge.uploaded { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.rf-badge.template { background: rgba(167,139,250,0.1); color: #c4b5fd; border-color: rgba(167,139,250,0.3); }

.rf-card-meta { font-size: 0.78rem; color: var(--rf-text-3); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.rf-card-meta-item { display: flex; align-items: center; gap: 0.3rem; }
.rf-card-meta-item svg { width: 12px; height: 12px; }

.rf-card-progress { }
.rf-card-progress-bar {
  height: 4px; background: var(--rf-surface); border-radius: 4px; overflow: hidden;
}
.rf-card-progress-fill {
  height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6366f1, #a78bfa); transition: width 0.5s ease;
}
.rf-card-progress-label { font-size: 0.72rem; color: var(--rf-text-3); margin-top: 4px; }

.rf-card-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0 1.25rem 1.25rem; margin-top: auto;
}
.rf-card-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  padding: 0.5rem 0.5rem; background: var(--rf-surface); border: 1px solid var(--rf-border);
  border-radius: 8px; color: var(--rf-text-2); font-size: 0.78rem; font-weight: 500;
  transition: all var(--rf-transition); white-space: nowrap;
}
.rf-card-btn:hover { background: var(--rf-surface-hover); color: var(--rf-text); border-color: var(--rf-border-strong); }
.rf-card-btn.btn-accent { background: var(--rf-accent-glow); color: var(--rf-accent-2); border-color: var(--rf-accent); }
.rf-card-btn.btn-accent:hover { background: rgba(99,102,241,0.35); }
.rf-card-btn.btn-del { color: #fca5a5; }
.rf-card-btn.btn-del:hover { background: var(--rf-danger-bg); border-color: rgba(239,68,68,0.3); }
.rf-card-btn svg { width: 13px; height: 13px; }

/* Shared card (read-only, no edit actions) */
.rf-shared-card .rf-card-body { padding-bottom: 0; }
.rf-shared-from { font-size: 0.78rem; color: var(--rf-text-3); display: flex; align-items: center; gap: 0.35rem; }
.rf-shared-from svg { width: 12px; height: 12px; }

/* ============================================================
   MODALS
   ============================================================ */
.rf-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(5,5,15,0.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: rf-overlay-in 0.2s ease;
}
@keyframes rf-overlay-in {
  from { opacity: 0; } to { opacity: 1; }
}

.rf-modal {
  background: var(--rf-bg-3); border: 1px solid var(--rf-border-strong);
  border-radius: var(--rf-radius-lg); width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--rf-shadow); animation: rf-modal-in 0.25s ease;
}
.rf-modal-wide { max-width: 760px; }
.rf-modal-sm { max-width: 380px; }
@keyframes rf-modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.rf-modal-fullscreen {
  align-items: stretch; padding: 0;
}
.rf-modal-fullscreen > * {
  border-radius: 0; max-width: none; max-height: none; min-height: 100vh; width: 100%;
}

.rf-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 1.5rem 1rem; border-bottom: 1px solid var(--rf-border);
}
.rf-modal-title { font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--rf-text); display: flex; align-items: center; gap: 0.5rem; }
.rf-modal-title svg { width: 20px; height: 20px; color: var(--rf-accent-2); }
.rf-modal-subtitle { color: var(--rf-text-2); font-size: 0.8125rem; margin-top: 0.25rem; }
.rf-modal-body { padding: 1.5rem; }
.rf-modal-close {
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 8px;
  color: var(--rf-text-2); padding: 0.4rem; display: flex; flex-shrink: 0;
  transition: all var(--rf-transition);
}
.rf-modal-close:hover { background: var(--rf-danger-bg); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.rf-modal-close svg { width: 16px; height: 16px; }

/* Template Picker Modal */
.template-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; padding: 1.5rem;
}
.template-picker-card {
  background: var(--rf-surface); border: 2px solid var(--rf-border); border-radius: var(--rf-radius);
  overflow: hidden; cursor: pointer; transition: all var(--rf-transition);
  display: flex; flex-direction: column;
}
.template-picker-card:hover { border-color: var(--rf-accent); transform: translateY(-2px); box-shadow: 0 4px 20px var(--rf-accent-glow); }
.template-picker-card.selected { border-color: var(--rf-accent); box-shadow: 0 0 0 1px var(--rf-accent), 0 4px 20px var(--rf-accent-glow); }
.template-thumb-preview {
  height: 140px; overflow: hidden; position: relative; background: #fff;
}
.template-thumb-preview .mini-resume { transform: scale(0.28); transform-origin: top center; width: 357%; margin-left: -128.5%; pointer-events: none; }
.template-picker-info { padding: 0.75rem; }
.template-picker-name { font-weight: 600; font-size: 0.875rem; color: var(--rf-text); }
.template-picker-style { font-size: 0.75rem; color: var(--rf-text-3); margin-top: 2px; }

/* ============================================================
   BUILDER WIZARD
   ============================================================ */
.rf-builder {
  display: flex; flex-direction: column; min-height: 100vh; background: var(--rf-bg-2);
}
.rf-builder-header {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem;
  background: var(--rf-bg); border-bottom: 1px solid var(--rf-border); flex-shrink: 0;
}
.rf-builder-back {
  display: flex; align-items: center; gap: 0.4rem; background: var(--rf-surface); border: 1px solid var(--rf-border);
  border-radius: 8px; color: var(--rf-text-2); padding: 0.45rem 0.9rem; font-size: 0.8125rem;
  transition: all var(--rf-transition); white-space: nowrap;
}
.rf-builder-back:hover { background: var(--rf-surface-hover); color: var(--rf-text); }
.rf-builder-back svg { width: 15px; height: 15px; }
.rf-builder-title-area { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.rf-builder-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--rf-text); truncate; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-builder-rename {
  background: none; border: none; color: var(--rf-text-3); padding: 4px; display: flex; transition: color var(--rf-transition); flex-shrink: 0;
}
.rf-builder-rename:hover { color: var(--rf-accent-2); }
.rf-builder-rename svg { width: 14px; height: 14px; }
.rf-builder-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.rf-builder-steps {
  display: flex; align-items: center; justify-content: center; gap: 0; padding: 1rem 1.5rem;
  background: var(--rf-bg); border-bottom: 1px solid var(--rf-border); flex-shrink: 0; overflow-x: auto;
}
.builder-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 500; color: var(--rf-text-3); position: relative; padding: 0 1.5rem;
  transition: color var(--rf-transition);
}
.builder-step::after {
  content: ''; position: absolute; left: 50%; right: -50%; top: 12px;
  height: 2px; background: var(--rf-border); z-index: 0;
}
.builder-step:last-child::after { display: none; }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--rf-surface); border: 2px solid var(--rf-border);
  display: flex; align-items: center; justify-content: center; transition: all var(--rf-transition); z-index: 1;
}
.builder-step.active { color: var(--rf-accent-2); }
.builder-step.active .step-dot { background: var(--rf-accent); border-color: var(--rf-accent); box-shadow: 0 0 0 4px var(--rf-accent-glow); }
.builder-step.completed { color: var(--rf-success); }
.builder-step.completed .step-dot { background: var(--rf-success); border-color: var(--rf-success); }
.builder-step.completed::after { background: var(--rf-success); }

.rf-completeness-bar {
  height: 3px; background: var(--rf-border); position: relative; flex-shrink: 0;
}
.rf-completeness-fill {
  height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa); transition: width 0.6s ease;
}
.rf-completeness-label {
  position: absolute; right: 1rem; top: 5px; font-size: 0.7rem; color: var(--rf-text-3);
}

.rf-builder-body { flex: 1; overflow-y: auto; padding: 2rem 1.5rem; }
.rf-builder-step-content { max-width: 800px; margin: 0 auto; }

.builder-section-title { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--rf-text); margin-bottom: 0.5rem; }
.builder-section-subtitle { color: var(--rf-text-2); font-size: 0.875rem; margin-bottom: 2rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }

.field-group .field-input-wrap.textarea-wrap { align-items: flex-start; min-height: 120px; }
.field-group .field-input.textarea {
  padding: 0.75rem 1rem; min-height: 120px; resize: vertical; width: 100%; background: transparent;
  border: none; outline: none; color: var(--rf-text); font-size: 0.9rem; line-height: 1.6;
}
.field-input-wrap.no-icon .field-input { padding-left: 1rem; }

/* Repeatable item card */
.repeatable-item {
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: var(--rf-radius);
  padding: 1.25rem; margin-bottom: 1rem; position: relative; transition: all var(--rf-transition);
}
.repeatable-item:hover { border-color: var(--rf-border-strong); }
.repeatable-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.repeatable-title { font-weight: 600; font-size: 0.9rem; color: var(--rf-text-2); display: flex; align-items: center; gap: 0.5rem; }
.repeatable-title svg { width: 15px; height: 15px; }
.repeatable-remove {
  background: none; border: none; color: var(--rf-text-3); padding: 4px; display: flex;
  transition: color var(--rf-transition); border-radius: 6px;
}
.repeatable-remove:hover { color: var(--rf-danger); background: var(--rf-danger-bg); }
.repeatable-remove svg { width: 14px; height: 14px; }
.btn-add-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.7rem 1rem;
  background: var(--rf-surface); border: 1px dashed var(--rf-border); border-radius: var(--rf-radius);
  color: var(--rf-accent-2); font-size: 0.875rem; font-weight: 500; transition: all var(--rf-transition);
  margin-top: 0.5rem;
}
.btn-add-item:hover { background: var(--rf-accent-glow); border-color: var(--rf-accent); }
.btn-add-item svg { width: 16px; height: 16px; }

/* Skills Tag Input */
.skills-tags-container {
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px;
  padding: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 60px;
  transition: border-color var(--rf-transition);
}
.skills-tags-container:focus-within { border-color: var(--rf-accent); box-shadow: 0 0 0 3px var(--rf-accent-glow); }
.skill-tag {
  display: inline-flex; align-items: center; gap: 0.35rem; background: var(--rf-accent-glow);
  border: 1px solid var(--rf-accent); color: var(--rf-accent-2); padding: 4px 10px;
  border-radius: 20px; font-size: 0.8rem; font-weight: 500;
}
.skill-tag button { background: none; border: none; color: var(--rf-accent-2); display: flex; padding: 0; cursor: pointer; }
.skill-tag button svg { width: 12px; height: 12px; }
.skill-tag-input { border: none; background: none; outline: none; color: var(--rf-text); font-size: 0.875rem; min-width: 120px; padding: 4px; }
.skill-tag-input::placeholder { color: var(--rf-text-3); }

.skill-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.skill-suggestion-chip {
  padding: 4px 12px; background: var(--rf-surface); border: 1px solid var(--rf-border);
  border-radius: 20px; font-size: 0.78rem; color: var(--rf-text-2); cursor: pointer; transition: all var(--rf-transition);
}
.skill-suggestion-chip:hover { background: var(--rf-accent-glow); color: var(--rf-accent-2); border-color: var(--rf-accent); }

.builder-template-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem;
}

.rf-builder-footer {
  display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem;
  background: var(--rf-bg); border-top: 1px solid var(--rf-border); flex-shrink: 0;
}
.rf-builder-step-indicator { font-size: 0.8125rem; color: var(--rf-text-3); }

/* ============================================================
   PREVIEW SHELL
   ============================================================ */
.rf-preview-shell {
  display: flex; flex-direction: column; min-height: 100vh; background: var(--rf-bg-2);
}
.rf-preview-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem;
  background: var(--rf-bg); border-bottom: 1px solid var(--rf-border); flex-shrink: 0; flex-wrap: wrap;
}
.rf-preview-toolbar-left, .rf-preview-toolbar-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.rf-preview-resume-name { font-weight: 600; font-size: 0.9rem; color: var(--rf-text); }

.rf-ats-banner {
  background: rgba(16,185,129,0.08); border-bottom: 1px solid rgba(16,185,129,0.2); padding: 0.75rem 1.5rem; flex-shrink: 0;
}
.rf-ats-inner { max-width: 800px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.rf-ats-score-wrap { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.rf-ats-label { font-size: 0.8rem; font-weight: 600; color: #6ee7b7; display: flex; align-items: center; gap: 0.35rem; }
.rf-ats-label svg { width: 14px; height: 14px; }
.rf-ats-bar { width: 140px; height: 6px; background: rgba(16,185,129,0.2); border-radius: 6px; overflow: hidden; }
.rf-ats-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #10b981, #6ee7b7); transition: width 0.6s ease; }
.rf-ats-value { font-size: 0.8rem; font-weight: 700; color: #6ee7b7; min-width: 35px; }
.rf-ats-tips { font-size: 0.78rem; color: var(--rf-text-2); flex: 1; }

.rf-preview-page-wrap {
  flex: 1; overflow-y: auto; padding: 2.5rem 1rem; display: flex; justify-content: center; background: #e8e8e8;
}
.rf-resume-paper-container {
  width: 210mm; min-height: 297mm; background: white; box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  border-radius: 2px; overflow: hidden;
}

/* Share Modal specifics */
.share-primary-info {
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: var(--rf-radius);
  padding: 1rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.75rem;
}
.share-input-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.share-people-list { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rf-border); }
.share-section-label { font-size: 0.8125rem; font-weight: 600; color: var(--rf-text-2); margin-bottom: 0.75rem; }
.share-person-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem; background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px;
  margin-bottom: 0.5rem;
}
.share-person-email { font-size: 0.875rem; color: var(--rf-text); }
.share-person-date { font-size: 0.75rem; color: var(--rf-text-3); }
.share-unshare-btn {
  background: none; border: none; color: #fca5a5; font-size: 0.78rem; padding: 0.3rem 0.6rem;
  border: 1px solid rgba(239,68,68,0.3); border-radius: 6px; cursor: pointer; transition: all var(--rf-transition);
}
.share-unshare-btn:hover { background: var(--rf-danger-bg); }
.share-empty-note { font-size: 0.8125rem; color: var(--rf-text-3); text-align: center; padding: 1rem; }

/* Upload Modal */
.upload-drop-zone {
  border: 2px dashed var(--rf-border-strong); border-radius: var(--rf-radius); padding: 2.5rem;
  text-align: center; cursor: pointer; transition: all var(--rf-transition);
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over { border-color: var(--rf-accent); background: var(--rf-accent-glow); }
.upload-drop-icon { display: flex; justify-content: center; margin-bottom: 1rem; color: var(--rf-accent-2); }
.upload-drop-icon svg { width: 48px; height: 48px; }
.upload-drop-title { font-weight: 600; font-size: 1rem; color: var(--rf-text); margin-bottom: 0.25rem; }
.upload-drop-sub { font-size: 0.8125rem; color: var(--rf-text-3); }
.upload-preview { margin-top: 1rem; }
.upload-file-info {
  display: flex; align-items: center; gap: 0.75rem; background: var(--rf-success-bg);
  border: 1px solid rgba(16,185,129,0.3); border-radius: 10px; padding: 0.75rem 1rem;
}
.upload-file-info svg { width: 24px; height: 24px; color: var(--rf-success); }
.upload-file-name { font-weight: 500; font-size: 0.875rem; color: var(--rf-text); }
.upload-file-size { font-size: 0.75rem; color: var(--rf-text-3); }
.upload-file-remove {
  margin-left: auto; background: none; border: none; color: var(--rf-text-3); display: flex; padding: 4px; transition: color var(--rf-transition);
}
.upload-file-remove:hover { color: var(--rf-danger); }
.upload-file-remove svg { width: 16px; height: 16px; }

/* Cover Letter */
.cover-letter-toolbar { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cover-letter-textarea {
  width: 100%; background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px;
  color: var(--rf-text); padding: 1rem; font-size: 0.9rem; line-height: 1.7; resize: vertical; outline: none; font-family: 'Source Serif 4', serif;
  transition: border-color var(--rf-transition);
}
.cover-letter-textarea:focus { border-color: var(--rf-accent); box-shadow: 0 0 0 3px var(--rf-accent-glow); }
.cover-letter-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Settings */
.settings-section { }
.settings-label { font-size: 0.9rem; font-weight: 600; color: var(--rf-text); margin-bottom: 0.25rem; }
.settings-hint { font-size: 0.8125rem; color: var(--rf-text-3); margin-bottom: 1rem; }
.danger-text { color: #fca5a5; }
.settings-options { display: flex; flex-direction: column; gap: 0.6rem; }
.settings-radio {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  background: var(--rf-surface); border: 1px solid var(--rf-border); border-radius: 10px; cursor: pointer;
  transition: all var(--rf-transition);
}
.settings-radio:has(input:checked) { background: var(--rf-accent-glow); border-color: var(--rf-accent); }
.settings-radio input { accent-color: var(--rf-accent); width: 16px; height: 16px; }
.settings-radio span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--rf-text-2); }
.settings-radio span svg { width: 15px; height: 15px; }

/* Confirm modal */
.confirm-message { color: var(--rf-text-2); font-size: 0.9rem; margin-bottom: 1.5rem; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Toast */
.rf-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--rf-bg-3); border: 1px solid var(--rf-border-strong); border-radius: 50px;
  padding: 0.7rem 1.25rem; display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.875rem; font-weight: 500; color: var(--rf-text); z-index: 9999;
  box-shadow: var(--rf-shadow); animation: toast-in 0.3s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.rf-toast svg { width: 16px; height: 16px; color: var(--rf-success); }
.rf-toast.error svg { color: var(--rf-danger); }

/* Print Only Container (hidden in screen, shown in print) */
.print-only-container { display: none; }

/* Checkbox custom */
input[type="checkbox"].rf-checkbox { accent-color: var(--rf-accent); width: 16px; height: 16px; cursor: pointer; }

/* ============================================================
   ================================================================
   RESUME TEMPLATES — 10 Distinct Professional Designs
   ================================================================
   ============================================================ */

/* BASE RESUME PAPER */
.resume-paper {
  width: 210mm; min-height: 297mm; font-family: 'Inter', sans-serif;
  font-size: 11pt; color: #1a1a2e; background: white; position: relative;
}

/* ============================================================
   TEMPLATE 1 — APEX (Dark Sidebar, White Main)
   ============================================================ */
.template-apex {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 210px 1fr;
  min-height: 297mm;
}
.template-apex .rp-header {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.template-apex .rp-full-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; color: white; }
.template-apex .rp-job-title { font-size: 1rem; color: #c7d2fe; font-weight: 400; margin-top: 0.25rem; }
.template-apex .rp-contact-block {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem;
  font-size: 0.75rem; color: #a5b4fc;
}
.template-apex .rp-sidebar {
  background: #1e1b4b; color: white; padding: 1.75rem 1.25rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.template-apex .rp-main { padding: 1.75rem 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-apex .rp-section-title {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: #a5b4fc; border-bottom: 1px solid rgba(165,180,252,0.2); padding-bottom: 0.4rem; margin-bottom: 0.75rem;
}
.template-apex .rp-main .rp-section-title { color: #312e81; border-bottom-color: #e0e7ff; }
.template-apex .rp-skill-item { font-size: 0.8rem; color: #c7d2fe; padding: 0.3rem 0; display: flex; align-items: center; gap: 0.4rem; }
.template-apex .rp-skill-item::before { content: '▸'; color: #6366f1; font-size: 0.6rem; }
.template-apex .rp-exp-item, .template-apex .rp-edu-item { margin-bottom: 1.1rem; }
.template-apex .rp-exp-role { font-weight: 700; font-size: 0.95rem; color: #1e1b4b; }
.template-apex .rp-exp-company { font-size: 0.85rem; color: #4338ca; font-weight: 500; }
.template-apex .rp-exp-dates { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.template-apex .rp-exp-desc { font-size: 0.82rem; color: #374151; margin-top: 0.4rem; line-height: 1.5; }
.template-apex .rp-summary-text { font-size: 0.85rem; color: #374151; line-height: 1.6; }
.template-apex .rp-lang-item { display: flex; justify-content: space-between; font-size: 0.78rem; color: #c7d2fe; padding: 0.2rem 0; }
.template-apex .rp-cert-name { font-size: 0.78rem; color: #c7d2fe; font-weight: 500; }
.template-apex .rp-cert-issuer { font-size: 0.7rem; color: #a5b4fc; }

/* ============================================================
   TEMPLATE 2 — NOVA (Minimal Serif, Single Column)
   ============================================================ */
.template-nova { padding: 3rem 3.5rem; font-family: 'Source Serif 4', serif; }
.template-nova .rp-header { text-align: center; border-bottom: 2px solid #1a1a2e; padding-bottom: 1.5rem; margin-bottom: 2rem; }
.template-nova .rp-full-name { font-size: 2.4rem; font-weight: 600; letter-spacing: 0.5px; color: #1a1a2e; }
.template-nova .rp-job-title { font-size: 1rem; color: #6b7280; font-style: italic; margin-top: 0.3rem; }
.template-nova .rp-contact-block { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.75rem; font-size: 0.8rem; color: #6b7280; flex-wrap: wrap; }
.template-nova .rp-contact-block span::before { content: '•'; margin-right: 0.5rem; }
.template-nova .rp-contact-block span:first-child::before { content: ''; }
.template-nova .rp-main { display: flex; flex-direction: column; gap: 1.5rem; }
.template-nova .rp-sidebar { display: none; }
.template-nova .rp-section-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #4b5563; margin-bottom: 0.75rem; }
.template-nova .rp-exp-item { padding-left: 1rem; border-left: 2px solid #e5e7eb; margin-bottom: 1rem; }
.template-nova .rp-exp-role { font-weight: 600; font-size: 0.95rem; color: #1f2937; }
.template-nova .rp-exp-company { font-size: 0.85rem; color: #6b7280; }
.template-nova .rp-exp-dates { font-size: 0.75rem; color: #9ca3af; margin-top: 0.1rem; }
.template-nova .rp-exp-desc { font-size: 0.83rem; color: #374151; margin-top: 0.35rem; line-height: 1.5; }
.template-nova .rp-summary-text { font-size: 0.88rem; color: #374151; line-height: 1.7; font-style: italic; }
.template-nova .rp-skills-inline { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.template-nova .rp-skill-pill { font-size: 0.78rem; color: #4b5563; padding: 2px 0; }
.template-nova .rp-skill-pill::after { content: ' • '; color: #d1d5db; }
.template-nova .rp-skill-pill:last-child::after { content: ''; }

/* ============================================================
   TEMPLATE 3 — PRISM (Gradient Header, Colorful Accents)
   ============================================================ */
.template-prism { }
.template-prism .rp-header {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #0ea5e9 100%);
  padding: 2.5rem 2.5rem 2rem; color: white;
}
.template-prism .rp-full-name { font-size: 2rem; font-weight: 800; color: white; letter-spacing: -0.5px; }
.template-prism .rp-job-title { font-size: 1rem; color: rgba(255,255,255,0.8); margin-top: 0.25rem; }
.template-prism .rp-contact-block { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.template-prism .rp-contact-item { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: rgba(255,255,255,0.85); }
.template-prism .rp-body { display: grid; grid-template-columns: 1fr; padding: 0; }
.template-prism .rp-sidebar { display: none; }
.template-prism .rp-main { padding: 2rem 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-prism .rp-section-title {
  font-size: 0.95rem; font-weight: 700; color: #4f46e5;
  border-left: 3px solid #7c3aed; padding-left: 0.75rem; margin-bottom: 0.75rem;
}
.template-prism .rp-exp-role { font-weight: 700; font-size: 0.95rem; color: #1f2937; }
.template-prism .rp-exp-company { font-size: 0.85rem; color: #7c3aed; font-weight: 500; }
.template-prism .rp-exp-dates { font-size: 0.75rem; color: #6b7280; }
.template-prism .rp-exp-desc { font-size: 0.82rem; color: #374151; margin-top: 0.35rem; line-height: 1.5; }
.template-prism .rp-exp-item { margin-bottom: 1rem; }
.template-prism .rp-summary-text { font-size: 0.875rem; color: #374151; line-height: 1.6; }
.template-prism .rp-skills-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.template-prism .rp-skill-chip { background: #ede9fe; color: #4f46e5; font-size: 0.78rem; font-weight: 500; padding: 3px 10px; border-radius: 20px; }

/* ============================================================
   TEMPLATE 4 — SLATE (Corporate Grey, Traditional)
   ============================================================ */
.template-slate { padding: 2.5rem; font-family: 'Inter', sans-serif; }
.template-slate .rp-header { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 3px solid #374151; }
.template-slate .rp-full-name { font-size: 1.9rem; font-weight: 700; color: #111827; }
.template-slate .rp-job-title { font-size: 1rem; color: #4b5563; margin-top: 0.2rem; }
.template-slate .rp-contact-block { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.75rem; }
.template-slate .rp-contact-item { font-size: 0.78rem; color: #6b7280; display: flex; align-items: center; gap: 0.35rem; }
.template-slate .rp-body { display: grid; grid-template-columns: 1fr 220px; gap: 2rem; }
.template-slate .rp-section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #374151; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.35rem; margin-bottom: 0.75rem; }
.template-slate .rp-exp-item { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-bottom: 1rem; }
.template-slate .rp-exp-role { font-weight: 600; font-size: 0.9rem; color: #111827; }
.template-slate .rp-exp-company { font-size: 0.83rem; color: #6b7280; }
.template-slate .rp-exp-dates { font-size: 0.75rem; color: #9ca3af; text-align: right; white-space: nowrap; }
.template-slate .rp-exp-desc { grid-column: 1 / -1; font-size: 0.81rem; color: #374151; line-height: 1.5; margin-top: 0.2rem; }
.template-slate .rp-summary-text { font-size: 0.85rem; color: #374151; line-height: 1.6; }
.template-slate .rp-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.template-slate .rp-skill-item { font-size: 0.8rem; color: #4b5563; padding: 0.25rem 0; border-bottom: 1px dotted #e5e7eb; }
.template-slate .rp-lang-item { display: flex; justify-content: space-between; font-size: 0.78rem; color: #4b5563; padding: 0.2rem 0; }

/* ============================================================
   TEMPLATE 5 — AURORA (Colorful Cards, Creative)
   ============================================================ */
.template-aurora { background: #f8f7ff; }
.template-aurora .rp-header {
  background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%);
  padding: 2.5rem; color: white; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); padding-bottom: 3.5rem;
}
.template-aurora .rp-full-name { font-size: 2.1rem; font-weight: 800; color: white; }
.template-aurora .rp-job-title { font-size: 1rem; color: rgba(255,255,255,0.85); margin-top: 0.25rem; }
.template-aurora .rp-contact-block { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; font-size: 0.78rem; color: rgba(255,255,255,0.8); }
.template-aurora .rp-body { padding: 1.5rem 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.template-aurora .rp-main { display: flex; flex-direction: column; gap: 1rem; }
.template-aurora .rp-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.template-aurora .rp-section { background: white; border-radius: 10px; padding: 1.1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.template-aurora .rp-section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #7c3aed; margin-bottom: 0.65rem; }
.template-aurora .rp-exp-role { font-weight: 700; font-size: 0.88rem; color: #1f2937; }
.template-aurora .rp-exp-company { font-size: 0.8rem; color: #ec4899; font-weight: 500; }
.template-aurora .rp-exp-dates { font-size: 0.72rem; color: #9ca3af; }
.template-aurora .rp-exp-desc { font-size: 0.78rem; color: #374151; margin-top: 0.3rem; line-height: 1.4; }
.template-aurora .rp-exp-item { margin-bottom: 0.75rem; }
.template-aurora .rp-summary-text { font-size: 0.82rem; color: #374151; line-height: 1.5; }
.template-aurora .rp-skill-chip { display: inline-block; background: linear-gradient(135deg, #f97316, #ec4899); color: white; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; margin: 2px; }

/* ============================================================
   TEMPLATE 6 — ZEN (Ultra Minimal, White Space)
   ============================================================ */
.template-zen { padding: 4rem 4.5rem; font-family: 'Inter', sans-serif; }
.template-zen .rp-header { margin-bottom: 3rem; }
.template-zen .rp-full-name { font-size: 2.5rem; font-weight: 300; letter-spacing: -1px; color: #111827; }
.template-zen .rp-job-title { font-size: 0.9rem; font-weight: 400; color: #9ca3af; margin-top: 0.4rem; letter-spacing: 0.1em; text-transform: uppercase; }
.template-zen .rp-contact-block { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }
.template-zen .rp-contact-item { font-size: 0.75rem; color: #9ca3af; }
.template-zen .rp-body { display: flex; flex-direction: column; gap: 2.5rem; }
.template-zen .rp-sidebar { display: none; }
.template-zen .rp-main { display: flex; flex-direction: column; gap: 2.5rem; }
.template-zen .rp-section-title { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #d1d5db; margin-bottom: 1rem; }
.template-zen .rp-exp-item { padding-bottom: 1.5rem; border-bottom: 1px solid #f3f4f6; margin-bottom: 0; }
.template-zen .rp-exp-role { font-size: 0.9rem; font-weight: 600; color: #111827; }
.template-zen .rp-exp-company { font-size: 0.82rem; color: #6b7280; }
.template-zen .rp-exp-dates { font-size: 0.73rem; color: #d1d5db; margin-top: 0.15rem; }
.template-zen .rp-exp-desc { font-size: 0.82rem; color: #4b5563; margin-top: 0.5rem; line-height: 1.6; }
.template-zen .rp-summary-text { font-size: 0.88rem; color: #6b7280; line-height: 1.8; font-weight: 300; }
.template-zen .rp-skills-inline { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.template-zen .rp-skill-item { font-size: 0.8rem; color: #6b7280; }

/* ============================================================
   TEMPLATE 7 — VOLT (Dark Mode, Neon Accents)
   ============================================================ */
.template-volt { background: #0d1117; color: #c9d1d9; }
.template-volt .rp-header {
  background: #161b22; border-bottom: 1px solid #30363d; padding: 2rem 2.5rem;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.template-volt .rp-full-name { font-size: 2rem; font-weight: 700; color: #f0f6fc; }
.template-volt .rp-job-title { font-size: 0.9rem; color: #39d353; margin-top: 0.25rem; font-family: 'Courier New', monospace; }
.template-volt .rp-contact-block { font-size: 0.75rem; color: #8b949e; text-align: right; display: flex; flex-direction: column; gap: 0.2rem; }
.template-volt .rp-body { display: grid; grid-template-columns: 200px 1fr; min-height: calc(297mm - 120px); }
.template-volt .rp-sidebar { background: #0d1117; border-right: 1px solid #30363d; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-volt .rp-main { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-volt .rp-section-title { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #39d353; margin-bottom: 0.65rem; display: flex; align-items: center; gap: 0.4rem; }
.template-volt .rp-section-title::after { content: ''; flex: 1; height: 1px; background: #30363d; }
.template-volt .rp-skill-item { font-size: 0.78rem; color: #58a6ff; padding: 0.2rem 0; }
.template-volt .rp-exp-role { font-weight: 600; font-size: 0.9rem; color: #f0f6fc; }
.template-volt .rp-exp-company { font-size: 0.82rem; color: #58a6ff; }
.template-volt .rp-exp-dates { font-size: 0.72rem; color: #484f58; }
.template-volt .rp-exp-desc { font-size: 0.8rem; color: #8b949e; margin-top: 0.35rem; line-height: 1.5; }
.template-volt .rp-exp-item { margin-bottom: 1rem; border-left: 2px solid #30363d; padding-left: 1rem; }
.template-volt .rp-summary-text { font-size: 0.85rem; color: #8b949e; line-height: 1.6; }
.template-volt .rp-lang-item { font-size: 0.78rem; color: #8b949e; padding: 0.2rem 0; }

/* ============================================================
   TEMPLATE 8 — CLASSIC (Traditional, ATS-Friendly)
   ============================================================ */
.template-classic { padding: 2.5rem 3rem; font-family: 'Times New Roman', Times, serif; }
.template-classic .rp-header { text-align: center; margin-bottom: 1rem; }
.template-classic .rp-full-name { font-size: 1.8rem; font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: 1px; }
.template-classic .rp-job-title { font-size: 0.9rem; color: #555; margin-top: 0.2rem; }
.template-classic .rp-contact-block { display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; font-size: 0.82rem; color: #333; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0.4rem 0; flex-wrap: wrap; }
.template-classic .rp-body { display: flex; flex-direction: column; }
.template-classic .rp-sidebar { display: none; }
.template-classic .rp-main { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1rem; }
.template-classic .rp-section-title { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; color: #000; border-bottom: 2px solid #000; padding-bottom: 2px; margin-bottom: 0.6rem; letter-spacing: 0.5px; }
.template-classic .rp-exp-item { margin-bottom: 0.8rem; }
.template-classic .rp-exp-header-row { display: flex; justify-content: space-between; align-items: baseline; }
.template-classic .rp-exp-role { font-weight: 700; font-size: 0.9rem; color: #000; }
.template-classic .rp-exp-dates { font-size: 0.82rem; color: #333; }
.template-classic .rp-exp-company { font-style: italic; font-size: 0.85rem; color: #333; }
.template-classic .rp-exp-desc { font-size: 0.83rem; color: #333; margin-top: 0.25rem; line-height: 1.4; }
.template-classic .rp-summary-text { font-size: 0.85rem; color: #333; line-height: 1.6; }
.template-classic .rp-skills-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.template-classic .rp-skill-item { font-size: 0.82rem; color: #333; }
.template-classic .rp-skill-item::after { content: ' • '; }
.template-classic .rp-skill-item:last-child::after { content: ''; }

/* ============================================================
   TEMPLATE 9 — MOSAIC (Grid-Based, Structured Blocks)
   ============================================================ */
.template-mosaic { padding: 0; overflow: hidden; }
.template-mosaic .rp-header {
  background: #0f172a; color: white; padding: 2rem 2.5rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
}
.template-mosaic .rp-full-name { font-size: 1.9rem; font-weight: 800; color: white; }
.template-mosaic .rp-job-title { font-size: 0.9rem; color: #94a3b8; margin-top: 0.2rem; }
.template-mosaic .rp-contact-block { display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-end; font-size: 0.75rem; color: #64748b; }
.template-mosaic .rp-body { display: grid; grid-template-columns: 1fr 240px; min-height: calc(297mm - 100px); }
.template-mosaic .rp-main { padding: 1.75rem 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-mosaic .rp-sidebar { background: #f8fafc; border-left: 1px solid #e2e8f0; padding: 1.75rem 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }
.template-mosaic .rp-section-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #0f172a; border-left: 3px solid #3b82f6; padding-left: 0.5rem; margin-bottom: 0.75rem; }
.template-mosaic .rp-sidebar .rp-section-title { color: #334155; border-left-color: #f59e0b; }
.template-mosaic .rp-exp-role { font-weight: 700; font-size: 0.9rem; color: #0f172a; }
.template-mosaic .rp-exp-company { font-size: 0.82rem; color: #3b82f6; font-weight: 500; }
.template-mosaic .rp-exp-dates { font-size: 0.72rem; color: #94a3b8; }
.template-mosaic .rp-exp-desc { font-size: 0.8rem; color: #475569; margin-top: 0.3rem; line-height: 1.5; }
.template-mosaic .rp-exp-item { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f1f5f9; }
.template-mosaic .rp-skills-grid { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.template-mosaic .rp-skill-chip { background: #dbeafe; color: #1d4ed8; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 5px; }
.template-mosaic .rp-summary-text { font-size: 0.84rem; color: #475569; line-height: 1.6; }
.template-mosaic .rp-lang-item { display: flex; justify-content: space-between; font-size: 0.78rem; color: #475569; padding: 0.25rem 0; border-bottom: 1px dotted #e2e8f0; }

/* ============================================================
   TEMPLATE 10 — BLOOM (Warm Pastels, Rounded, Friendly)
   ============================================================ */
.template-bloom { background: #fffbf5; padding: 2.5rem; }
.template-bloom .rp-header {
  background: linear-gradient(135deg, #fed7aa 0%, #fde68a 100%);
  border-radius: 16px; padding: 2rem 2.5rem; margin-bottom: 2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.template-bloom .rp-full-name { font-size: 2rem; font-weight: 800; color: #78350f; }
.template-bloom .rp-job-title { font-size: 0.9rem; color: #92400e; margin-top: 0.2rem; }
.template-bloom .rp-contact-block { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; font-size: 0.78rem; color: #92400e; }
.template-bloom .rp-body { display: grid; grid-template-columns: 1fr 220px; gap: 1.5rem; }
.template-bloom .rp-section { background: white; border-radius: 12px; padding: 1.1rem 1.25rem; box-shadow: 0 2px 8px rgba(120,53,15,0.06); margin-bottom: 1rem; }
.template-bloom .rp-section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #b45309; margin-bottom: 0.65rem; }
.template-bloom .rp-exp-role { font-weight: 700; font-size: 0.9rem; color: #1c1917; }
.template-bloom .rp-exp-company { font-size: 0.82rem; color: #b45309; font-weight: 500; }
.template-bloom .rp-exp-dates { font-size: 0.73rem; color: #a8a29e; }
.template-bloom .rp-exp-desc { font-size: 0.8rem; color: #44403c; margin-top: 0.3rem; line-height: 1.5; }
.template-bloom .rp-exp-item { margin-bottom: 0.85rem; }
.template-bloom .rp-summary-text { font-size: 0.85rem; color: #44403c; line-height: 1.6; }
.template-bloom .rp-sidebar { display: flex; flex-direction: column; }
.template-bloom .rp-main { display: flex; flex-direction: column; }
.template-bloom .rp-skill-chip { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-size: 0.73rem; font-weight: 500; padding: 3px 9px; border-radius: 20px; margin: 2px; display: inline-block; }
.template-bloom .rp-lang-item { display: flex; justify-content: space-between; font-size: 0.78rem; color: #44403c; padding: 0.25rem 0; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body > *:not(#print-only-container) { display: none !important; }
  .print-only-container { display: block !important; }
  #print-only-container { position: fixed; inset: 0; z-index: 99999; background: white; }
  #print-resume-content { width: 100%; }
  @page { margin: 0; size: A4; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .rf-header-inner { padding: 0 1rem; gap: 0.75rem; }
  .rf-user-info { display: none; }
  .rf-header-nav .btn-secondary { display: none; }
  .rf-main-content { padding: 1rem; }
  .rf-resume-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.triple { grid-template-columns: 1fr; }
  .rf-preview-toolbar { flex-direction: column; align-items: flex-start; }
  .template-picker-grid { grid-template-columns: repeat(2, 1fr); }
  .rf-resume-paper-container { width: 100%; min-height: auto; }
  .rf-preview-page-wrap { padding: 1rem; }
  .resume-paper { width: 100%; }
  .rf-builder-steps { gap: 0; }
  .builder-step span { display: none; }
  .cover-letter-toolbar { flex-direction: column; }
  .share-input-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .auth-card { padding: 1.5rem; }
  .rf-panel-header { flex-direction: column; }
  .rf-card-actions { }
}

/* ============================================================
   THEME TOGGLE BUTTON & LIGHT MODE OVERRIDES
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--rf-radius-sm);
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  color: var(--rf-text-2);
  cursor: pointer;
  transition: all var(--rf-transition);
  outline: none;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--rf-surface-hover);
  color: var(--rf-text);
  border-color: var(--rf-border-strong);
  transform: translateY(-1px);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* Component Specific Light Mode Overrides */
[data-theme="light"] .rf-ambient {
  opacity: 0.35;
}

[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .rf-header {
  background: rgba(248, 250, 252, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .rf-tabs-bar {
  background: rgba(248, 250, 252, 0.78);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .rf-resume-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .rf-resume-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #btn-upload-resume,
[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #475569 !important;
}
[data-theme="light"] #btn-upload-resume:hover,
[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .rf-modal-overlay {
  background: rgba(15, 23, 42, 0.4);
}

[data-theme="light"] .rf-modal {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .rf-user-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .field-input-wrap,
[data-theme="light"] .rf-search-box,
[data-theme="light"] .skills-tags-container,
[data-theme="light"] .repeatable-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .field-input,
[data-theme="light"] .rf-search-box input {
  color: #0f172a;
}

[data-theme="light"] .rf-card-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569;
}
[data-theme="light"] .rf-card-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

[data-theme="light"] .rf-preview-page-wrap {
  background: rgba(0, 0, 0, 0.04);
}

