:root {
  --bg-dark:        #0f172a;
  --bg-gradient:    linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg:       rgba(30, 41, 59, 0.80);
  --glass-border:   rgba(255, 255, 255, 0.10);
  --primary:        #6366f1;
  --primary-hover:  #4f46e5;
  --primary-light:  rgba(99, 102, 241, 0.12);
  --text-main:      #f8fafc;
  --text-muted:     #94a3b8;
  --danger:         #ef4444;
  --success:        #22c55e;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Poppins', sans-serif; }

.app-header {
  text-align: center;
  padding: 28px 20px 8px;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
}

.app-header h1 span { color: var(--primary); }

.app-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 75vh;
  padding: 20px;
}

.login-container .glass-card {
  padding: 52px 44px;
  max-width: 440px;
  width: 100%;
}

.login-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.text-center { text-align: center; }
.text-center h2 { font-size: 22px; margin-bottom: 12px; }
.text-center p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 28px; }

.auth-btn {
  width: 100%;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.container {
  display: flex;
  gap: 32px;
  max-width: 1380px;
  margin: 16px auto 60px;
  padding: 0 28px;
  align-items: flex-start;
}

.form-panel {
  width: 390px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 40px);
}

/* Progress */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 6px;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.progress-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.progress-bar {
  height: 3px;
  background: var(--glass-border);
  margin: 0 20px 4px;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.4);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  padding: 11px 6px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.tab i { font-size: 16px; }
.tab:hover { color: var(--text-main); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-light); }

.tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.tab-panel::-webkit-scrollbar { width: 4px; }
.tab-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.tab-panel.active { display: block; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label i { color: var(--primary); font-size: 15px; }

.input-group { margin-bottom: 14px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder, textarea::placeholder { color: rgba(148,163,184,0.5); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

select option { background: #1e293b; color: var(--text-main); }

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.entry-block {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.date-input-wrapper {
  position: relative;
}

.date-display {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.date-display:hover { border-color: rgba(99, 102, 241, 0.5); }
.date-display:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.date-display:disabled { cursor: not-allowed; opacity: 0.55; }
.date-display span { color: var(--text-main); }
.date-display i { color: var(--primary); font-size: 14px; flex-shrink: 0; margin-left: 8px; }

.date-picker-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 230px;
  background: #1e293b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
  padding: 10px;
  z-index: 60;
}

.date-picker-popup.open { display: block; }

.dp-year-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.dp-year-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.dp-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}

.dp-nav-btn:hover { color: var(--primary); background: var(--primary-light); }

.dp-month-grid, .dp-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dp-month-btn {
  padding: 7px 4px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-align: center;
}

.dp-month-btn:hover { border-color: rgba(99, 102, 241, 0.5); color: var(--primary); }
.dp-month-btn.selected { background: var(--primary); color: white; }

.present-check {
  display: flex !important;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  cursor: pointer;
}

.present-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  padding: 3px 5px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.remove-btn:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.remove-btn i { pointer-events: none; }

.add-btn {
  width: 100%;
  padding: 9px 14px;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.add-btn:hover { background: var(--primary-light); border-color: var(--primary); }


.action-buttons {
  padding: 14px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.checklist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.chip i { font-size: 10px; }
.chip-done { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.chip-miss { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

button { transition: transform 0.15s, box-shadow 0.15s, background 0.2s; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-primary {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-danger.outline {
  padding: 11px 20px;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-danger.outline:hover { background: rgba(239, 68, 68, 0.1); }
.full-width { width: 100%; }

.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.preview-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-label i { color: var(--primary); }
.preview-hint { font-size: 11px; color: rgba(148,163,184,0.6); }

.paper-preview {
  background: #ffffff;
  color: #1e293b;
  width: 100%;
  min-height: 297mm;
  padding: 48px 52px;
  border-radius: 6px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  color: #94a3b8;
  gap: 14px;
}

.preview-empty p { font-size: 14px; line-height: 1.6; font-style: italic; }


.r-header { margin-bottom: 18px; }
.r-name { font-size: 28px; font-weight: 700; color: #0f172a; font-family: 'Poppins', sans-serif; line-height: 1.2; }
.r-title { font-size: 14px; font-weight: 500; color: #6366f1; margin-top: 3px; }
.r-contacts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.r-contact { font-size: 12px; color: #475569; display: flex; align-items: center; gap: 5px; }
.r-contact i { color: #6366f1; font-size: 13px; }
a.r-contact { text-decoration: none; cursor: pointer; }
a.r-contact:hover { text-decoration: underline; }
.r-divider { border: none; border-top: 2.5px solid #6366f1; margin: 16px 0 14px; }

.r-section { margin-bottom: 18px; }
.r-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #334155;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-family: 'Poppins', sans-serif;
}

.r-summary { font-size: 13px; color: #334155; line-height: 1.7; }

.r-exp-item { margin-bottom: 14px; }
.r-exp-header { display: flex; justify-content: space-between; align-items: flex-start; }
.r-exp-company { font-weight: 700; font-size: 13.5px; color: #0f172a; }
.r-exp-role { font-size: 12.5px; color: #6366f1; font-weight: 500; margin-top: 1px; }
.r-exp-dates { font-size: 12px; color: #64748b; white-space: nowrap; margin-left: 12px; padding-top: 1px; }
.r-bullets { margin: 7px 0 0 18px; padding: 0; list-style: disc; }
.r-bullets li { font-size: 12.5px; color: #334155; margin-bottom: 3px; line-height: 1.55; }

.r-edu-item { margin-bottom: 10px; }
.r-edu-degree { font-weight: 600; font-size: 13px; color: #0f172a; }
.r-edu-school { font-size: 12.5px; color: #475569; }
.r-edu-year { font-size: 12px; color: #64748b; margin-top: 1px; }

.r-skills-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.r-skill-tag { background: #eef2ff; color: #4338ca; font-size: 11.5px; padding: 3px 11px; border-radius: 20px; font-weight: 500; }
.r-lang-tag { background: #ecfdf5; color: #065f46; }

.r-proj-item { margin-bottom: 11px; }
.r-proj-name { font-weight: 600; font-size: 13px; color: #0f172a; display: flex; align-items: center; gap: 6px; }
.r-proj-tech { font-weight: 400; font-size: 12px; color: #64748b; }
.r-proj-link { color: #6366f1; font-size: 13px; text-decoration: none; }
.r-proj-desc { font-size: 12.5px; color: #334155; margin-top: 3px; line-height: 1.55; }


.template-classic .r-name { color: #0f172a; }

.template-modern .r-header { text-align: center; }
.template-modern .r-name { color: #6366f1; font-size: 32px; }
.template-modern .r-contacts { justify-content: center; }
.template-modern .r-divider { border-top: 2px dashed #94a3b8; width: 80px; margin: 16px auto 14px; }
.template-modern .r-section-title { color: #6366f1; border-bottom-color: #c7d2fe; text-align: center; }
.template-modern .r-skill-tag { background: #ede9fe; color: #6d28d9; }

.template-minimalist .r-name { font-weight: 400; letter-spacing: 3px; font-size: 22px; color: #000; text-transform: uppercase; }
.template-minimalist .r-title { color: #555; font-weight: 400; }
.template-minimalist .r-contact { color: #555; }
.template-minimalist .r-contact i { color: #555; }
.template-minimalist .r-divider { border-top: 1px solid #000; }
.template-minimalist .r-section-title { color: #000; border-bottom-color: #000; font-size: 10px; letter-spacing: 2px; }
.template-minimalist .r-exp-company { color: #000; }
.template-minimalist .r-exp-role { color: #333; }
.template-minimalist .r-skill-tag { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.template-minimalist .r-lang-tag { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

#intro-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e1b4b 50%,
    #312e81 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: introFadeOut 0.8s ease 2.5s forwards;
}

.intro-content {
  text-align: center;
}

.intro-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 64px;
  font-weight: 700;
  color: white;
  letter-spacing: 1px;
  opacity: 0;
  transform: scale(0.85);
  animation: logoReveal 1s ease forwards;
}

.intro-logo::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.intro-subtitle {
  margin-top: 20px;
  font-size: 18px;
  color: #cbd5e1;
  opacity: 0;
  transform: translateY(12px);
  animation: subtitleReveal 0.8s ease 0.8s forwards;
}

@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes subtitleReveal {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introFadeOut {
  0% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

.app-footer {
  text-align: center;
  padding: 20px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted); 
  border-top: 1px solid var(--glass-border);
}

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    gap: 20px;
  }

  .form-panel {
    width: 100%;
    position: static;
    top: auto;
    max-height: none;
  }

  .tab-panel {
    max-height: none;
    overflow-y: visible;
  }

  .preview-panel {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 22px 16px 6px;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .app-tagline {
    font-size: 12px;
  }

  .login-container {
    min-height: 70vh;
    padding: 16px;
  }

  .login-container .glass-card {
    padding: 36px 24px;
  }

  .login-icon {
    font-size: 42px;
  }

  .container {
    padding: 0 12px;
    margin: 12px auto 36px;
    gap: 16px;
  }

  .form-panel {
    border-radius: var(--radius-md);
  }

  .progress-header {
    padding: 14px 16px 6px;
  }

  .progress-bar {
    margin: 0 16px 4px;
  }

  .tab {
    padding: 10px 4px;
    font-size: 11px;
  }

  .tab i {
    font-size: 15px;
  }

  .tab-panel {
    padding: 14px 16px;
  }

  input, textarea, select, .date-display {
    font-size: 16px;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-buttons {
    padding: 12px 16px;
  }

  .btn-primary,
  .btn-danger.outline {
    padding: 13px 16px;
    font-size: 14px;
  }

  .preview-toolbar {
    padding: 0 2px;
  }

  .paper-preview {
    padding: 22px 16px;
    min-height: 0;
  }

  .r-name {
    font-size: 22px;
  }

  .r-contacts {
    gap: 5px 12px;
  }

  .date-picker-popup {
    max-width: calc(100vw - 56px);
  }

  .app-footer {
    padding: 16px;
    font-size: 11px;
  }

  .intro-logo {
    font-size: 42px;
  }

  .intro-subtitle {
    font-size: 15px;
    padding: 0 20px;
  }
}

@media (max-width: 420px) {
  .app-header h1 {
    font-size: 21px;
  }

  .login-container .glass-card {
    padding: 30px 18px;
  }

  .login-icon {
    font-size: 36px;
  }

  .tabs {
    flex-wrap: nowrap;
  }

  .tab {
    font-size: 10px;
    padding: 9px 2px;
  }

  .tab i {
    font-size: 14px;
  }

  .section-label {
    font-size: 10px;
  }

  .paper-preview {
    padding: 16px 12px;
  }

  .r-name {
    font-size: 19px;
  }

  .intro-logo {
    font-size: 34px;
  }
}