/* Shahzeb Risk & Position Size Calculator - Frontend Styles
   All selectors are namespaced with .st-rc- to avoid any theme/plugin conflicts. */

.st-rc-container {
	--st-rc-accent: #0f6b4c;
	--st-rc-accent-dark: #0b4f38;
	--st-rc-text: #1a1f27;
	--st-rc-text-muted: #5b6472;
	--st-rc-border: #e2e5ea;
	--st-rc-bg: #ffffff;
	--st-rc-bg-subtle: #f7f8fa;
	--st-rc-error: #c0392b;
	--st-rc-radius: 10px;
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.st-rc-container *,
.st-rc-container *::before,
.st-rc-container *::after {
	box-sizing: border-box;
}

.st-rc-card {
	background: var(--st-rc-bg);
	border: 1px solid var(--st-rc-border);
	border-radius: var(--st-rc-radius);
	padding: 28px;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.st-rc-header {
	margin-bottom: 24px;
}

.st-rc-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--st-rc-text);
}

.st-rc-subtitle {
	font-size: 14px;
	color: var(--st-rc-text-muted);
	margin: 0;
}

.st-rc-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.st-rc-field {
	display: flex;
	flex-direction: column;
}

.st-rc-label,
.st-rc-sublabel {
	font-size: 14px;
	font-weight: 600;
	color: var(--st-rc-text);
	margin-bottom: 6px;
}

.st-rc-sublabel {
	margin-top: 14px;
}

.st-rc-input {
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid var(--st-rc-border);
	border-radius: 8px;
	background: var(--st-rc-bg);
	color: var(--st-rc-text);
	transition: border-color 0.15s ease;
}

.st-rc-input:focus {
	outline: 3px solid rgba(15, 107, 76, 0.25);
	outline-offset: 1px;
	border-color: var(--st-rc-accent);
}

.st-rc-input.st-rc-input-error {
	border-color: var(--st-rc-error);
}

.st-rc-hint {
	font-size: 13px;
	color: var(--st-rc-text-muted);
	margin: 6px 0 0;
}

.st-rc-error {
	font-size: 13px;
	color: var(--st-rc-error);
	margin: 6px 0 0;
	min-height: 0;
}

.st-rc-error:empty {
	display: none;
}

.st-rc-toggle {
	display: inline-flex;
	border: 1px solid var(--st-rc-border);
	border-radius: 8px;
	overflow: hidden;
	width: 100%;
}

.st-rc-toggle-btn {
	flex: 1 1 0;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 600;
	background: var(--st-rc-bg-subtle);
	color: var(--st-rc-text-muted);
	border: none;
	cursor: pointer;
}

.st-rc-toggle-btn + .st-rc-toggle-btn {
	border-left: 1px solid var(--st-rc-border);
}

.st-rc-toggle-btn.is-active {
	background: var(--st-rc-accent);
	color: #ffffff;
}

.st-rc-toggle-btn:focus-visible {
	outline: 3px solid rgba(15, 107, 76, 0.35);
	outline-offset: -3px;
}

.st-rc-subfield.is-hidden {
	display: none;
}

.st-rc-grid-two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.st-rc-submit {
	margin-top: 4px;
	padding: 14px 20px;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	background: var(--st-rc-accent);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.st-rc-submit:hover,
.st-rc-submit:focus-visible {
	background: var(--st-rc-accent-dark);
}

.st-rc-submit:focus-visible {
	outline: 3px solid rgba(15, 107, 76, 0.35);
	outline-offset: 2px;
}

.st-rc-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.st-rc-results {
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--st-rc-border);
}

.st-rc-results.is-hidden {
	display: none;
}

.st-rc-results-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--st-rc-text);
}

.st-rc-result-highlight {
	background: var(--st-rc-bg-subtle);
	border: 1px solid var(--st-rc-border);
	border-radius: 8px;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 14px;
}

.st-rc-result-highlight-label {
	font-size: 13px;
	color: var(--st-rc-text-muted);
	font-weight: 600;
}

.st-rc-result-highlight-value {
	font-size: 28px;
	font-weight: 800;
	color: var(--st-rc-accent);
}

.st-rc-result-list {
	margin: 0;
}

.st-rc-result-row {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--st-rc-border);
	font-size: 14px;
}

.st-rc-result-row:last-child {
	border-bottom: none;
}

.st-rc-result-row dt {
	color: var(--st-rc-text-muted);
}

.st-rc-result-row dd {
	margin: 0;
	font-weight: 700;
	color: var(--st-rc-text);
}

.st-rc-reference-note {
	font-size: 12px;
	color: var(--st-rc-text-muted);
	margin-top: 12px;
}

.st-rc-reference-note.is-hidden {
	display: none;
}

.st-rc-result-actions {
	display: flex;
	gap: 10px;
	margin-top: 18px;
}

.st-rc-btn-secondary {
	flex: 1 1 0;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	background: var(--st-rc-bg);
	color: var(--st-rc-text);
	border: 1px solid var(--st-rc-border);
	border-radius: 8px;
	cursor: pointer;
}

.st-rc-btn-secondary:hover,
.st-rc-btn-secondary:focus-visible {
	background: var(--st-rc-bg-subtle);
}

.st-rc-btn-secondary:focus-visible {
	outline: 3px solid rgba(15, 107, 76, 0.25);
	outline-offset: 2px;
}

.st-rc-disclaimer {
	margin-top: 22px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--st-rc-text-muted);
}

.st-rc-details {
	margin-top: 14px;
	border-top: 1px solid var(--st-rc-border);
	padding-top: 14px;
}

.st-rc-details summary {
	font-size: 14px;
	font-weight: 600;
	color: var(--st-rc-text);
	cursor: pointer;
}

.st-rc-details summary:focus-visible {
	outline: 3px solid rgba(15, 107, 76, 0.25);
	outline-offset: 2px;
}

.st-rc-details-content {
	margin-top: 10px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--st-rc-text-muted);
}

.st-rc-details-content h4 {
	color: var(--st-rc-text);
	font-size: 14px;
	margin: 14px 0 4px;
}

.st-rc-details-content h4:first-child {
	margin-top: 0;
}

/* Responsive breakpoints */
@media (max-width: 480px) {
	.st-rc-card {
		padding: 20px 16px;
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.st-rc-title {
		font-size: 19px;
	}

	.st-rc-grid-two {
		grid-template-columns: 1fr;
	}

	.st-rc-result-actions {
		flex-direction: column;
	}
}
