/* autoreload.css — the standing instruction to buy your own credits.
 *
 * Note the scoping. `.settings-section button` in app.css is accent-filled and outguns a plain
 * class selector, so every button in here is scoped under `#autoreload` or it comes out as a wall
 * of red. app.css:547 already documents the same collision for the credit packs, and the Tools
 * panel hit it a third time. */

#autoreload { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.ar-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }

/* The card on file. */
.ar-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.ar-card-has  { font-size: var(--fs-sm); color: var(--text-primary); }
.ar-card-none { font-size: var(--fs-sm); color: var(--text-muted); }
#autoreload .ar-card-btn {
	background: var(--bg-tertiary);
	border: 1px solid var(--border-strong);
	color: var(--text-secondary);
	border-radius: var(--radius-sm);
	font-size: var(--fs-xs);
	padding: 4px 10px;
}
#autoreload .ar-card-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
#autoreload .ar-card-btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-fill, #fff); }
#autoreload .ar-card-btn.accent:hover { background: var(--accent-hover); }

/* The switch. Disabled without a card, and dimmed so it reads as unavailable rather than off. */
.ar-switch { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-primary); margin-bottom: 14px; }
.ar-switch input { accent-color: var(--accent); width: 15px; height: 15px; }
.ar-switch input:disabled { opacity: 0.5; }
.ar-switch input:disabled + span { color: var(--text-muted); }

/* The three numbers. When auto-reload is off they are greyed, because they configure a thing
   that is not running -- but they stay editable, so it can be set up and then switched on. */
.ar-field { margin-bottom: 12px; }
.ar-label { display: block; font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 4px; }
/* The currency and the number are drawn as one control -- the prefix drops its
   right border and its right corners so the seam disappears -- and `stretch` is
   the only thing that makes that true. A span takes the page's 1.5 line-height
   and an input takes the UA's `normal`, so at identical padding the prefix
   stands about 4px taller than the box it is joined to; centred, that came out
   as a step above AND below the seam. Stretched, the two are the same height by
   construction, whatever line-height the browser gives a form control. The same
   fix, for the same reason, as .models-credit-form in models.css. */
.ar-input-row { display: flex; align-items: stretch; gap: 0; }
.ar-ccy {
	background: var(--bg-tertiary);
	border: 1px solid var(--border-strong);
	border-right: none;
	border-radius: var(--radius-sm) 0 0 var(--radius-sm);
	color: var(--text-muted);
	font-size: var(--fs-sm);
	padding: 7px 9px;
}
#autoreload .ar-input {
	flex: 1;
	min-width: 0;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-strong);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text-primary);
	font-size: var(--fs-sm);
	padding: 7px 10px;
	font-family: var(--font-mono);
}
#autoreload .ar-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ar-hint { font-size: var(--fs-2xs); color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
/* The billing note is a direct child of the panel, not of a field. */
#autoreload > .ar-hint { margin-top: 8px; }

#autoreload.ar-off .ar-field { opacity: 0.55; }

/* What it has spent against the ceiling this month — the number that answers
   "is this running away with my money". */
.ar-spent { margin: 14px 0 4px; }
.ar-bar { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; margin-bottom: 5px; }
.ar-bar-fill { height: 100%; background: var(--accent); transition: width 0.2s; }
.ar-spent-txt { font-size: var(--fs-2xs); color: var(--text-secondary); font-family: var(--font-mono); }

/* A card that has expired or been declined must be said out loud, BEFORE the balance runs out. */
.ar-last-error {
	margin-top: 10px;
	padding: 8px 10px;
	border: 1px solid var(--danger);
	border-radius: var(--radius-sm);
	color: var(--danger);
	font-size: var(--fs-xs);
	line-height: 1.45;
}

.ar-actions { margin-top: 14px; }
#autoreload .ar-save {
	background: var(--accent);
	border: none;
	color: var(--on-fill, #fff);
	border-radius: var(--radius-sm);
	font-size: var(--fs-sm);
	padding: 7px 16px;
}
#autoreload .ar-save:hover { background: var(--accent-hover); }
#autoreload .ar-save:disabled { opacity: 0.5; }

.ar-note { margin-top: 8px; font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.45; }
.ar-note.bad { color: var(--danger); }
