/* ==========================================================================
   ClientRecap — Minimalist Warm Light Theme
   Clean, editorial aesthetic for freelance developers
   ========================================================================== */

:root {
  /* Warm Paper & Light Neutral Palette */
  --bg-app: #FAF8F4;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-subtle: #F3EFEA;
  --bg-hover: #ECE7E0;
  
  /* Borders */
  --border-color: #E6E1D8;
  --border-focus: #EA580C;
  --border-light: #F0ECE4;

  /* Typography Colors */
  --text-main: #1C1917;         /* Near black (Stone 900) */
  --text-secondary: #57534E;    /* Balanced readable gray (Stone 600) */
  --text-muted: #8C857B;        /* Subtle meta gray */
  --text-inverse: #FFFFFF;

  /* Accent Color: Confident Editorial Warm Orange */
  --accent: #EA580C;
  --accent-hover: #C2410C;
  --accent-soft: #FFF7ED;
  --accent-border: #FDBA74;

  /* Typography Families */
  --font-serif: 'Newsreader', Georgia, Cambria, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Crisp, smaller radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  /* Subtle, clean paper shadows */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
  --shadow-email: 0 1px 3px rgba(28, 25, 23, 0.05), 0 6px 16px rgba(28, 25, 23, 0.03);
  --shadow-focus: 0 0 0 3px rgba(234, 88, 12, 0.12);

  --transition-fast: 0.15s ease;
}

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

html, body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;                /* Chrome / Safari */
}

/* Layout Wrapper */
.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  margin-left: 0.4rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.75rem;
  padding: 2.5rem 1rem 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  letter-spacing: 0.01em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.9rem;
}

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

/* Main Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
  flex: 1;
}

/* Base Panel */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.step-indicator {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.step-indicator-accent {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

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

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.btn-clear:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* Form Styles */
.recap-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.required-indicator {
  color: var(--accent);
}

.badge-optional {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
}

.label-with-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.input-icon {
  position: absolute;
  left: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 2.3rem;
}

/* Input Fields */
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.form-control::placeholder {
  color: #A8A29E;
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 180px;
}

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

/* Tone Toggle */
.tone-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.tone-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tone-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.tone-option input:checked + .tone-pill {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tone-icon {
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-xs);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

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

.btn-success {
  background: #166534 !important;
  border-color: #166534 !important;
  color: #FFFFFF !important;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #D6D0C4;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-generate {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.btn-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255,255,255,0.85);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  margin-left: auto;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.loading .btn-spinner {
  display: inline-block;
}

.btn.loading .btn-icon {
  display: none;
}

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

/* Output Panel Layout */
.panel-output {
  min-height: 540px;
  background: #FFFFFF;
}

.output-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Empty Placeholder */
.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  margin: auto 0;
}

.placeholder-graphic {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.placeholder-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.placeholder-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

.placeholder-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.p-feature {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.p-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Loading State */
.output-loading {
  padding: 1.5rem 0.5rem;
  margin: auto 0;
  width: 100%;
}

.loading-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.loading-spinner-ring {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.skeleton-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(90deg, #E6E1D8 0%, #F5F2EC 50%, #E6E1D8 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-header { height: 20px; width: 65%; margin-bottom: 0.5rem; }
.skeleton-w90 { width: 90%; }
.skeleton-w85 { width: 85%; }
.skeleton-w80 { width: 80%; }
.skeleton-w75 { width: 75%; }
.skeleton-w60 { width: 60%; }
.skeleton-w40 { width: 40%; }
.skeleton-spacer { height: 10px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================================
   Email Preview Card (Looks like an actual email in an inbox/composer)
   ========================================================================== */
.email-preview-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-email);
  overflow: hidden;
}

/* Email Subject / Header Bar */
.email-meta-bar {
  background: #FAF8F4;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
}

.email-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.email-meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subject-content-wrap {
  flex: 1;
}

.subject-input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
}

.subject-input:focus {
  border-bottom: 1px dashed var(--accent);
}

/* Email Body Area (clean email styling) */
.email-body-container {
  padding: 1.75rem 1.5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
  background: #FFFFFF;
}

.email-body-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  outline: none;
  font-family: inherit;
}

.email-body-text:focus {
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-focus);
  padding: 0.25rem;
}

/* Email Bottom Actions Toolbar */
.email-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: #FAF8F4;
  border-top: 1px solid var(--border-color);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Toast Notification (Warm Minimalist) */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: #1C1917;
  border: 1px solid #292524;
  color: #FFFFFF;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.toast-success {
  background: #1C1917;
  border-left: 3px solid var(--accent);
}

@keyframes toast-in {
  from {
    transform: translateY(10px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Modal Dialog (Warm Clean Styling) */
.modal-dialog {
  margin: auto;
  border: none;
  background: transparent;
  padding: 1.5rem;
  max-width: 620px;
  width: 90vw;
}

.modal-dialog::backdrop {
  background: rgba(28, 25, 23, 0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.comparison-card {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.82rem;
}

.comparison-card.bad {
  background: #FFF1F2;
  border: 1px solid #FFE4E6;
}

.comparison-card.good {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.comp-label {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.comparison-card code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

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

.modal-tips h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.modal-tips ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Footer */
.app-footer {
  text-align: center;
  padding-top: 3.5rem;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  
  .app-wrapper {
    padding: 1rem 1rem 2.5rem;
  }
  
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}
