/* Rep Counter — brass-on-forest gym styling
   Palette:
   --repctr-dark   #132621  deep forest (track, text, secondary actions)
   --repctr-gold   #A46900  brass/amber (progress, primary actions)
   Variants: data-variant="card" (default) | "hero" (seamless, no chrome)
   Themes:   data-theme="light" (default) | "dark"
*/

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

.repctr-widget {
	--repctr-dark: #132621;
	--repctr-gold: #A46900;
	--repctr-gold-dark: #85560a;

	--repctr-bg: #F7F3EA;
	--repctr-border: rgba(19, 38, 21, 0.12);
	--repctr-text: #132621;
	--repctr-text-70: rgba(19, 38, 21, 0.7);
	--repctr-track: rgba(19, 38, 21, 0.06);
	--repctr-complete-ring: var(--repctr-dark);
	--repctr-complete-bg: var(--repctr-dark);
	--repctr-complete-text: #fff;
	--repctr-minus-bg: rgba(19, 38, 21, 0.06);
	--repctr-minus-text: var(--repctr-dark);
	--repctr-dot-inactive: rgba(19, 38, 21, 0.2);
	--repctr-input-bg: rgba(19, 38, 21, 0.04);
	--repctr-shadow: 0 1px 2px rgba(19,38,21,0.04), 0 12px 28px -18px rgba(19,38,21,0.35);

	box-sizing: border-box;
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	padding: clamp(18px, 3vw, 26px) clamp(20px, 4vw, 32px);
	background: var(--repctr-bg);
	border: 1px solid var(--repctr-border);
	border-radius: 20px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--repctr-text);
	text-align: center;
	box-shadow: var(--repctr-shadow);
}

.repctr-widget[data-theme="dark"] {
	--repctr-bg: #132621;
	--repctr-border: rgba(247, 243, 234, 0.1);
	--repctr-text: #F7F3EA;
	--repctr-text-70: rgba(247, 243, 234, 0.65);
	--repctr-track: rgba(247, 243, 234, 0.12);
	--repctr-complete-ring: #F7F3EA;
	--repctr-complete-bg: #F7F3EA;
	--repctr-complete-text: #132621;
	--repctr-minus-bg: rgba(247, 243, 234, 0.1);
	--repctr-minus-text: #F7F3EA;
	--repctr-dot-inactive: rgba(247, 243, 234, 0.22);
	--repctr-input-bg: rgba(247, 243, 234, 0.08);
	--repctr-shadow: none;
}

.repctr-widget[data-variant="hero"] {
	background: transparent;
	border: none;
	box-shadow: none;
	max-width: 800px;
	padding: 8px 4px 0;
}

.repctr-widget *,
.repctr-widget *::before,
.repctr-widget *::after {
	box-sizing: border-box;
}

/* Hard reset so the parent theme's own button/link styling (including its
   :hover and :focus colors) can never bleed into the widget. */
.repctr-widget button,
.repctr-widget input,
.repctr-widget select {
	font-family: inherit;
	line-height: normal;
	text-decoration: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

.repctr-widget button:hover,
.repctr-widget button:focus,
.repctr-widget button:active,
.repctr-widget a:hover {
	text-decoration: none !important;
}

.repctr-widget button:focus-visible,
.repctr-widget input:focus-visible,
.repctr-widget select:focus-visible {
	outline: 2px solid var(--repctr-gold);
	outline-offset: 2px;
}

.repctr-panel.is-hidden {
	display: none;
}

/* Counter panel: fixed-height 3-column layout on wide screens (~800x300) */
.repctr-panel-counter {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(16px, 3vw, 32px);
	height: 252px;
}

.repctr-col {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.repctr-col-left {
	flex: 1 1 220px;
	align-items: flex-start;
	text-align: left;
}

.repctr-col-center {
	flex: 0 0 auto;
	align-items: center;
	text-align: center;
}

.repctr-col-right {
	flex: 1 1 220px;
	align-items: stretch;
	text-align: center;
	max-width: 260px;
}

/* Eyebrow */
.repctr-eyebrow {
	font-family: 'Inter', sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--repctr-gold);
	margin-bottom: 8px;
}

/* Header */
.repctr-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.repctr-icon {
	font-size: 18px;
	line-height: 1;
}

.repctr-title {
	margin: 0;
	font-family: 'Oswald', 'Inter', sans-serif;
	font-weight: 600;
	font-size: clamp(15px, 3vw, 18px);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--repctr-text);
}

.repctr-gear {
	position: absolute;
	top: 0;
	right: 0;
	appearance: none;
	background: none;
	border: none;
	color: var(--repctr-text-70);
	cursor: pointer;
	padding: 4px;
	display: flex;
	border-radius: 8px;
	transition: color 0.15s ease, background 0.15s ease;
}

.repctr-gear:hover {
	color: var(--repctr-text) !important;
	background: var(--repctr-track) !important;
}

/* Ring */
.repctr-ring-wrap {
	position: relative;
	width: clamp(160px, 24vw, 192px);
	height: clamp(160px, 24vw, 192px);
	margin: 0 auto 10px;
}

.repctr-ring {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.repctr-ring-track {
	fill: none;
	stroke: var(--repctr-track);
	stroke-width: 14;
}

.repctr-ring-progress {
	fill: none;
	stroke: var(--repctr-gold);
	stroke-width: 14;
	stroke-linecap: round;
	stroke-dasharray: 603.19;
	stroke-dashoffset: 603.19;
	transition: stroke-dashoffset 0.25s ease, stroke 0.25s ease;
}

.repctr-ring-progress.is-complete {
	stroke: var(--repctr-complete-ring);
}

.repctr-ring-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	pointer-events: none;
}

.repctr-count {
	font-family: 'Oswald', 'Inter', sans-serif;
	font-weight: 700;
	font-size: clamp(42px, 11vw, 54px);
	line-height: 1;
	color: var(--repctr-text);
	font-variant-numeric: tabular-nums;
}

.repctr-target {
	font-family: 'Oswald', 'Inter', sans-serif;
	font-weight: 500;
	font-size: clamp(15px, 4vw, 18px);
	color: var(--repctr-text-70);
	align-self: flex-end;
	margin-bottom: 6px;
}

/* Status */
.repctr-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 500;
	color: var(--repctr-text-70);
}

.repctr-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--repctr-gold);
	transition: background 0.2s ease;
}

.repctr-status.is-complete .repctr-status-dot {
	background: var(--repctr-complete-ring);
}

/* +/- controls */
.repctr-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 10px;
}

.repctr-btn {
	appearance: none;
	border: none;
	border-radius: 14px;
	font-size: 20px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
	line-height: 1;
	padding: 13px 0;
}

.repctr-btn:active {
	transform: scale(0.96);
}

.repctr-minus {
	background: var(--repctr-minus-bg);
	color: var(--repctr-minus-text);
}

.repctr-minus:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.repctr-plus {
	background: var(--repctr-gold);
	color: #fff;
}

.repctr-plus:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.repctr-minus:hover:not(:disabled) {
	background: var(--repctr-minus-bg) !important;
	color: var(--repctr-minus-text) !important;
	filter: brightness(1.06);
}

.repctr-plus:hover:not(:disabled) {
	background: var(--repctr-gold) !important;
	color: #fff !important;
	filter: brightness(1.06);
}

/* Complete set */
.repctr-complete {
	width: 100%;
	appearance: none;
	border: none;
	border-radius: 14px;
	background: var(--repctr-complete-bg);
	color: var(--repctr-complete-text);
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0.01em;
	padding: 15px 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 10px;
	transition: filter 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}

.repctr-complete:hover:not(:disabled) {
	background: var(--repctr-complete-bg) !important;
	color: var(--repctr-complete-text) !important;
	filter: brightness(1.12);
}

.repctr-complete:active {
	transform: scale(0.985);
}

.repctr-complete:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.repctr-check {
	font-size: 13px;
}

/* Set dots */
.repctr-sets {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 14px;
}

.repctr-set {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Oswald', sans-serif;
	font-size: 13px;
	font-weight: 600;
	border: 1.5px solid var(--repctr-dot-inactive);
	color: var(--repctr-text-70);
	background: transparent;
	transition: all 0.2s ease;
}

.repctr-set.is-active {
	border-color: var(--repctr-gold);
	color: var(--repctr-gold-dark);
}

.repctr-widget[data-theme="dark"] .repctr-set.is-active {
	color: var(--repctr-gold);
}

.repctr-set.is-done {
	background: var(--repctr-gold);
	border-color: var(--repctr-gold);
	color: #fff;
}

/* Session totals */
.repctr-totals {
	font-size: 12px;
	color: var(--repctr-text-70);
	margin-bottom: 16px;
}

.repctr-totals-reps,
.repctr-totals-sets {
	font-weight: 600;
	color: var(--repctr-text);
}

/* Footer */
.repctr-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--repctr-track);
}

.repctr-undo,
.repctr-reset {
	appearance: none;
	background: none;
	border: none;
	color: var(--repctr-text-70);
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	padding: 4px 2px;
}

.repctr-undo:hover:not(:disabled),
.repctr-reset:hover {
	color: var(--repctr-text) !important;
	background: none !important;
}

.repctr-undo:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.repctr-divider {
	color: var(--repctr-dot-inactive);
	font-size: 13px;
}

/* Rest panel */
.repctr-panel-rest {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px 0 4px;
}

.repctr-rest-label {
	font-family: 'Oswald', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--repctr-gold);
}

.repctr-rest-count {
	font-family: 'Oswald', 'Inter', sans-serif;
	font-weight: 700;
	font-size: clamp(56px, 16vw, 72px);
	line-height: 1;
	color: var(--repctr-text);
	font-variant-numeric: tabular-nums;
	margin: 6px 0;
}

.repctr-rest-sub {
	font-size: 13px;
	color: var(--repctr-text-70);
	margin-bottom: 16px;
}

.repctr-rest-start,
.repctr-rest-skip {
	width: 100%;
	max-width: 260px;
	appearance: none;
	border: none;
	border-radius: 14px;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	padding: 14px 0;
	cursor: pointer;
	margin-bottom: 10px;
}

.repctr-rest-start {
	background: var(--repctr-gold);
	color: #fff;
}

.repctr-rest-start:hover {
	background: var(--repctr-gold) !important;
	color: #fff !important;
	filter: brightness(1.1);
}

.repctr-rest-start.is-hidden,
.repctr-rest-skip.is-hidden {
	display: none;
}

.repctr-rest-skip {
	background: none;
	color: var(--repctr-text-70);
	margin-bottom: 0;
}

.repctr-rest-skip:hover {
	color: var(--repctr-text) !important;
	background: none !important;
}

/* Settings panel */
.repctr-panel-settings {
	text-align: left;
}

.repctr-settings-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
}

.repctr-settings-back {
	appearance: none;
	background: var(--repctr-track);
	border: none;
	border-radius: 10px;
	width: 30px;
	height: 30px;
	font-size: 15px;
	color: var(--repctr-text);
	cursor: pointer;
	flex: none;
}

.repctr-settings-back:hover {
	background: var(--repctr-track) !important;
	color: var(--repctr-text) !important;
	filter: brightness(0.95);
}

.repctr-settings-title {
	margin: 0;
	font-family: 'Oswald', sans-serif;
	font-weight: 600;
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--repctr-text);
}

.repctr-settings-form {
	max-height: min(60vh, 420px);
	overflow-y: auto;
	padding-right: 2px;
}

.repctr-field {
	display: block;
	margin-bottom: 14px;
}

.repctr-field-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--repctr-text-70);
	margin-bottom: 6px;
}

.repctr-input {
	width: 100%;
	appearance: none;
	border: 1px solid var(--repctr-border);
	background: var(--repctr-input-bg);
	color: var(--repctr-text);
	border-radius: 10px;
	padding: 10px 12px;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
}

select.repctr-input {
	cursor: pointer;
}

.repctr-chip-row {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.repctr-chip {
	appearance: none;
	border: 1px solid var(--repctr-border);
	background: transparent;
	color: var(--repctr-text-70);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.repctr-chip:hover {
	border-color: var(--repctr-gold) !important;
	color: var(--repctr-gold-dark) !important;
	background: rgba(164, 105, 0, 0.06) !important;
}

.repctr-widget[data-theme="dark"] .repctr-chip:hover {
	color: var(--repctr-gold) !important;
}

.repctr-chip.is-selected {
	border-color: var(--repctr-gold);
	color: var(--repctr-gold-dark);
	background: rgba(164, 105, 0, 0.1);
}

.repctr-chip.is-selected:hover {
	background: rgba(164, 105, 0, 0.16) !important;
}

.repctr-widget[data-theme="dark"] .repctr-chip.is-selected {
	color: var(--repctr-gold);
}

.repctr-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.repctr-toggle-row .repctr-field-label {
	margin-bottom: 0;
}

.repctr-toggle {
	position: relative;
	display: inline-flex;
	flex: none;
}

.repctr-toggle input {
	position: absolute;
	opacity: 0;
	width: 44px;
	height: 24px;
	margin: 0;
	cursor: pointer;
}

.repctr-toggle-track {
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: var(--repctr-dot-inactive);
	display: block;
	position: relative;
	transition: background 0.2s ease;
}

.repctr-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s ease;
}

.repctr-toggle input:checked + .repctr-toggle-track {
	background: var(--repctr-gold);
}

.repctr-toggle input:checked + .repctr-toggle-track .repctr-toggle-thumb {
	transform: translateX(20px);
}

.repctr-rest-fields {
	border-left: 2px solid var(--repctr-track);
	padding-left: 12px;
	margin: -4px 0 14px;
}

.repctr-rest-fields.is-hidden {
	display: none;
}

.repctr-settings-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--repctr-track);
	margin-top: 4px;
}

.repctr-settings-defaults {
	appearance: none;
	background: none;
	border: none;
	color: var(--repctr-text-70);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	padding: 8px 0;
}

.repctr-settings-defaults:hover {
	color: var(--repctr-text) !important;
	background: none !important;
}

.repctr-settings-save {
	appearance: none;
	border: none;
	border-radius: 12px;
	background: var(--repctr-gold);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	padding: 11px 22px;
	cursor: pointer;
}

.repctr-settings-save:hover {
	background: var(--repctr-gold) !important;
	color: #fff !important;
	filter: brightness(1.08);
}

/* Below ~680px there isn't room for 3 columns at a readable size — stack instead */
@media (max-width: 680px) {
	.repctr-panel-counter {
		flex-direction: column;
		height: auto;
		gap: 4px;
	}

	.repctr-col-left,
	.repctr-col-center,
	.repctr-col-right {
		align-items: center;
		text-align: center;
		max-width: none;
		width: 100%;
	}

	.repctr-header {
		justify-content: center;
	}

	.repctr-eyebrow {
		text-align: center;
	}

	.repctr-ring-wrap {
		width: clamp(170px, 46vw, 210px);
		height: clamp(170px, 46vw, 210px);
		margin: 4px auto 10px;
	}

	.repctr-count {
		font-size: clamp(44px, 13vw, 58px);
	}

	.repctr-status {
		margin-bottom: 14px;
	}

	.repctr-sets {
		margin: 4px 0 14px;
	}

	.repctr-totals {
		margin-bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.repctr-ring-progress,
	.repctr-btn,
	.repctr-complete,
	.repctr-toggle-thumb {
		transition: none;
	}
}
