/* ===== Cover Letter Generator — Styles ===== */
/* Colors: #2563eb primary, #059669 green secondary, #f8fafc bg, #1e293b text */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #059669;
  --secondary-hover: #047857;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 15px rgba(0, 0, 0, 0.1);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ===== Language Switcher ===== */
.lang-bar {
  background: var(--text);
  color: #fff;
  text-align: center;
  padding: 6px 16px;
  font-size: 0.85rem;
}
.lang-bar button {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin: 0 3px;
  transition: background 0.2s;
}
.lang-bar button:hover,
.lang-bar button.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* ===== Header ===== */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
header .logo span { color: var(--secondary); }
header nav a {
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}
header nav a:hover { color: var(--primary); text-decoration: none; }

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
  flex: 1;
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  margin-bottom: 40px;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Layout: Form + Preview ===== */
.app-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}
.app-layout .panel { min-width: 0; }

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
}

/* ===== Panel Cards ===== */
.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

/* ===== Form Styles ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-group label .required {
  color: #dc2626;
  margin-left: 2px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-group textarea {
  min-height: 80px;
  resize: vertical;
}
.form-group textarea.large {
  min-height: 120px;
}

/* ===== Template Selector ===== */
.template-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.template-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-light);
  transition: all 0.2s;
  text-align: center;
}
.template-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.template-btn.active {
  border-color: var(--primary);
  background: #eef2ff;
  color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--secondary-hover);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ===== Preview ===== */
#preview-area {
  white-space: pre-wrap;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
}
#preview-area p {
  margin-bottom: 12px;
}
#preview-area .placeholder-text {
  color: var(--text-light);
  font-style: italic;
  font-family: var(--font);
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 9999;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 40px 20px 24px;
  margin-top: 40px;
}
footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
footer .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
footer h3 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}
footer a {
  color: #94a3b8;
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
footer a:hover { color: #fff; text-decoration: none; }
footer .bottom {
  border-top: 1px solid #334155;
  padding-top: 16px;
  font-size: 0.8rem;
  text-align: center;
  color: #64748b;
}

/* ===== Legal Pages ===== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
}
.legal-content h1 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}
.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
}
.legal-content p,
.legal-content ul {
  margin-bottom: 12px;
  color: var(--text-light);
}
.legal-content ul { padding-left: 24px; }
.legal-content li { margin-bottom: 6px; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none; }
/* ─── Footer: cross-links inline ────────────────────────────────── */
footer .cross-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  padding: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
footer .cross-links strong {
  color: #e2e8f0;
  font-weight: 600;
  margin-right: 0.25rem;
}
footer .cross-links a {
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
}
footer .cross-links a:hover {
  color: #fff;
  text-decoration: underline;
}
footer .footer-bottom {
  text-align: center;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
footer .footer-bottom h4 {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
footer .legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
}
footer .legal-links a {
  color: #64748b;
  text-decoration: none;
}
footer .legal-links a:hover {
  color: #fff;
  text-decoration: underline;
}
