/* ==========================================================================
   Rent Receipt & HRA Exemption Generator - Stylesheet
   Usetra Tools Design System
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08);
}

.rr-app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 1rem 3.5rem;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rr-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.rr-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.rr-breadcrumb a:hover { color: var(--primary); }

.rr-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.rr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.rr-hero h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.35rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
.rr-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Action Bar */
.rr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}
.rr-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.rr-stat-pill {
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 700;
}
.rr-stat-pill span { color: var(--primary); }

.rr-btn-sec {
  padding: 0.5rem 0.9rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}
.rr-btn-sec:hover { background: #e2e8f0; }

.rr-btn-primary {
  padding: 0.65rem 1.35rem;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.28);
  transition: transform 0.15s, background 0.15s;
}
.rr-btn-primary:hover { background: #15803d; transform: translateY(-1px); }

/* Studio Layout */
.rr-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.25fr);
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .rr-grid { grid-template-columns: 1fr; }
}

/* Cards */
.rr-form-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.rr-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.rr-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rr-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 560px) {
  .rr-row-2 { grid-template-columns: 1fr; }
}
.rr-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.rr-field:last-child { margin-bottom: 0; }
.rr-field label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
}
.rr-input, .rr-select, .rr-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-main);
  background: #ffffff;
  font-family: inherit;
  box-sizing: border-box;
}
.rr-input:focus, .rr-select:focus, .rr-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* FY Pills */
.rr-fy-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.rr-fy-pill {
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  border-radius: 9999px;
  cursor: pointer;
}
.rr-fy-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* PAN Alert Banner */
.rr-alert {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  margin-top: 0.4rem;
}
.rr-alert.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.rr-alert.ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.rr-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.5rem;
  cursor: pointer;
}

/* HRA Calculator Result Box */
.rr-hra-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-top: 0.75rem;
}
.rr-hra-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.rr-hra-final {
  display: flex;
  justify-content: space-between;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--primary);
  padding-top: 0.45rem;
  margin-top: 0.45rem;
  border-top: 1px dashed var(--primary-border);
}

/* Preview Stack (Right Column) */
.rr-preview-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.rr-receipt-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 1.35rem 1.65rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  break-inside: avoid;
  page-break-inside: avoid;
}
.rc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.6rem;
  margin-bottom: 0.9rem;
}
.rc-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f172a;
  text-transform: uppercase;
}
.rc-sub {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}
.rc-meta {
  text-align: right;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
}
.rc-body {
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.rc-highlight {
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px dotted #94a3b8;
  padding: 0 3px;
}
.rc-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.8rem;
}
.rc-landlord-meta {
  line-height: 1.55;
  color: #334155;
}
.rc-stamp-area {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}
.rc-rev-stamp {
  width: 68px;
  height: 54px;
  border: 1.5px dashed #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  line-height: 1.2;
}
.rc-sign-box {
  text-align: right;
  min-width: 145px;
}
.rc-sign-line {
  border-top: 1px solid #0f172a;
  margin-top: 30px;
  padding-top: 4px;
  font-weight: 700;
  color: #0f172a;
}

/* Print Layout: cleanly prints 3 receipts per A4 page */
@media print {
  body { background: #ffffff !important; margin: 0 !important; padding: 0 !important; }
  [data-global-header], [data-global-footer], .rr-breadcrumb, .rr-hero, .rr-toolbar, .rr-form-col, .rr-seo-section {
    display: none !important;
  }
  .rr-app-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .rr-grid { display: block !important; }
  .rr-preview-col { gap: 14px !important; }
  .rr-receipt-card {
    box-shadow: none !important;
    border: 1.5px solid #334155 !important;
    padding: 14px 18px !important;
    margin-bottom: 12px !important;
  }
  @page { size: A4 portrait; margin: 10mm 12mm; }
}

/* SEO Section */
.rr-seo-section {
  max-width: 960px;
  margin: 4rem auto 0;
  border-top: 1px solid var(--border-color);
  padding-top: 2.75rem;
}
.rr-seo-section h2 { font-size: 1.65rem; font-weight: 800; color: var(--text-main); margin: 1.75rem 0 0.85rem; }
.rr-seo-section h2:first-child { margin-top: 0; }
.rr-seo-section h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); margin: 1.35rem 0 0.5rem; }
.rr-seo-section p, .rr-seo-section li { color: #475569; font-size: 0.98rem; line-height: 1.75; margin-bottom: 0.85rem; }
.rr-seo-section ul, .rr-seo-section ol { padding-left: 1.4rem; margin-bottom: 1.25rem; }
.rr-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
}
.rr-table th, .rr-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
}
.rr-table th { background: var(--bg-subtle); font-weight: 700; color: var(--text-main); }

.rr-faq-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.rr-faq-item { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: #ffffff; overflow: hidden; }
.rr-faq-q {
  width: 100%; padding: 1rem 1.25rem; text-align: left; background: none; border: none;
  font-size: 0.98rem; font-weight: 700; color: var(--text-main); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.rr-faq-a { padding: 0 1.25rem 1rem; color: var(--text-muted); font-size: 0.94rem; line-height: 1.65; display: none; }
.rr-faq-item.open .rr-faq-a { display: block; }
