/* Aussie Tax Genius — Invoice Generator Styles */

.atg-invoice-generator {
  max-width: 780px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a;
}

/* Tier banner */
.atg-tier-banner {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}
.atg-tier-banner--free { background: #fff8e1; border: 1px solid #f9a825; color: #7a5c00; }
.atg-tier-banner--pro  { background: #e8f5e9; border: 1px solid #2e7d32; color: #1b5e20; }

/* Tabs */
.atg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 28px;
}
.atg-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.atg-tab--active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  font-weight: 600;
}

/* Form */
.atg-step h2 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.atg-step h3 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
.atg-hint    { font-size: 13px; color: #666; margin: 0 0 20px; }

.atg-form-row {
  margin-bottom: 16px;
}
.atg-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}
.atg-form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.atg-required      { color: #d32f2f; }
.atg-required-note { font-size: 11px; color: #888; font-weight: 400; }

.atg-invoice-generator input[type="text"],
.atg-invoice-generator input[type="email"],
.atg-invoice-generator input[type="tel"],
.atg-invoice-generator input[type="date"],
.atg-invoice-generator input[type="number"],
.atg-invoice-generator textarea,
.atg-invoice-generator select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.atg-invoice-generator input:focus,
.atg-invoice-generator textarea:focus,
.atg-invoice-generator select:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.atg-invoice-generator input:disabled,
.atg-invoice-generator textarea:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* ABN lookup */
.atg-input-with-btn { display: flex; gap: 8px; }
.atg-input-with-btn input { flex: 1; }
.atg-abn-status { font-size: 12px; margin-top: 4px; display: block; }
.atg-abn-status--valid   { color: #2e7d32; }
.atg-abn-status--invalid { color: #d32f2f; }
.atg-abn-status--loading { color: #888; }

/* Buttons */
.atg-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.atg-btn--primary   { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.atg-btn--primary:hover { background: #1558b0; border-color: #1558b0; }
.atg-btn--secondary { background: #fff; color: #333; border-color: #ccc; }
.atg-btn--secondary:hover { background: #f5f5f5; }
.atg-btn--ghost     { background: transparent; color: #666; border-color: #ddd; }
.atg-btn--ghost:hover { background: #f5f5f5; }
.atg-btn--ai        { background: #6200ea; color: #fff; border-color: #6200ea; }
.atg-btn--ai:hover  { background: #4a00b0; }
.atg-btn:disabled   { opacity: 0.5; cursor: not-allowed; }

/* AI box */
.atg-ai-box {
  background: #f8f4ff;
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.atg-ai-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.atg-ai-badge  { background: #6200ea; color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.atg-upgrade-note { font-size: 13px; color: #555; margin-top: 8px; }
.atg-upgrade-note a { color: #6200ea; }

/* Invoice items table */
.atg-items-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.atg-items-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  padding: 6px 8px;
  border-bottom: 1px solid #e0e0e0;
}
.atg-items-table td { padding: 6px 8px; vertical-align: middle; }
.atg-items-table td input { padding: 6px 8px; }
.atg-item-row:hover { background: #fafafa; }
.atg-delete-item { background: none; border: none; color: #d32f2f; cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }

/* Totals */
.atg-totals {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 14px 20px;
  max-width: 320px;
  margin: 16px 0 20px auto;
}
.atg-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: #444;
}
.atg-totals-row--total {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  border-top: 1px solid #ddd;
  margin-top: 6px;
  padding-top: 10px;
}

/* Navigation */
.atg-step-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  align-items: center;
}
.atg-step-nav--actions { flex-wrap: wrap; }
.atg-remaining-note { font-size: 12px; color: #888; }

/* Preview */
.atg-preview {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.atg-preview-header { display: flex; justify-content: space-between; margin-bottom: 28px; }
.atg-preview h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.atg-preview-meta table { font-size: 13px; }
.atg-preview-meta td { padding: 2px 0 2px 12px; }
.atg-preview-meta .lbl { color: #888; }
.atg-preview table.items { width: 100%; border-collapse: collapse; margin: 20px 0 12px; }
.atg-preview table.items th { background: #f5f5f5; padding: 8px 10px; text-align: left; font-size: 12px; color: #666; border-bottom: 2px solid #ddd; }
.atg-preview table.items th.r, .atg-preview table.items td.r { text-align: right; }
.atg-preview table.items td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }
.atg-preview .totals-block { float: right; width: 260px; }
.atg-preview .totals-block table { width: 100%; font-size: 13px; }
.atg-preview .totals-block td { padding: 4px 8px; }
.atg-preview .totals-block td:last-child { text-align: right; font-weight: 600; }
.atg-preview .total-final { background: #1a1a1a; color: #fff; font-size: 15px; }
.atg-preview .total-final td { padding: 10px 8px; }
.atg-preview .gst-note { clear: both; font-size: 12px; color: #666; border-top: 1px solid #eee; padding-top: 12px; margin-top: 8px; }
.atg-gst-free-badge { font-size: 10px; background: #e8f5e9; color: #2e7d32; padding: 2px 6px; border-radius: 3px; margin-left: 4px; }

/* Result */
.atg-result-success { background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 8px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.atg-result-success p { margin: 0; font-weight: 500; color: #1b5e20; }

/* Notices */
.atg-notice { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.atg-notice--info    { background: #e3f2fd; border: 1px solid #90caf9; color: #0d47a1; }
.atg-notice--error   { background: #ffebee; border: 1px solid #ef9a9a; color: #b71c1c; }
.atg-notice--warning { background: #fff8e1; border: 1px solid #ffe082; color: #7a5c00; }

/* Spinner */
.atg-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: atg-spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes atg-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
  .atg-form-row--split { grid-template-columns: 1fr; }
  .atg-tabs { flex-wrap: wrap; }
  .atg-preview { padding: 16px; }
}
