/**
 * Worldwide Gold Loan Calculator - front-end styles.
 * All selectors are prefixed with "glc-" to avoid clashing with themes
 * or other plugins. Colors/spacing are driven by CSS custom properties
 * set inline per-instance from the WordPress admin design settings.
 */

.glc-calculator {
	--glc-primary: #b8860b;
	--glc-secondary: #2d2d2d;
	--glc-button: #b8860b;
	--glc-radius: 10px;
	--glc-font-size: 15px;

	box-sizing: border-box;
	max-width: 900px;
	margin: 0 auto 2rem;
	font-size: var(--glc-font-size);
	line-height: 1.5;
	color: var(--glc-secondary);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.glc-calculator *,
.glc-calculator *::before,
.glc-calculator *::after {
	box-sizing: inherit;
}

.glc-calculator.glc-theme-dark {
	--glc-secondary: #f2f2f2;
	background: #1b1b1b;
	padding: 1.25rem;
	border-radius: var(--glc-radius);
}

/* Intro */
.glc-intro {
	margin-bottom: 1.25rem;
}

.glc-intro__heading {
	font-size: 1.5em;
	font-weight: 700;
	margin: 0 0 0.4rem;
	color: var(--glc-secondary);
}

.glc-intro__description {
	margin: 0;
	opacity: 0.85;
}

/* Form layout */
.glc-form {
	background: #fff;
	border: 1px solid #e4e4e7;
	border-radius: var(--glc-radius);
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}

.glc-theme-dark .glc-form {
	background: #232323;
	border-color: #333;
}

.glc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

@media (min-width: 720px) {
	.glc-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.glc-field-group {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.glc-field-group__title {
	font-weight: 700;
	font-size: 0.95em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--glc-primary);
	padding: 0 0 0.6rem;
	margin: 0 0 0.75rem;
	border-bottom: 2px solid var(--glc-primary);
}

.glc-field {
	margin-bottom: 0.9rem;
}

.glc-field--inline {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
}

.glc-field label,
.glc-field__label-text {
	display: block;
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 0.3rem;
}

.glc-input {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid #d4d4d8;
	border-radius: calc(var(--glc-radius) * 0.5);
	font-size: 1em;
	background: #fff;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.glc-theme-dark .glc-input {
	background: #2c2c2c;
	border-color: #444;
	color: #f2f2f2;
}

.glc-input:focus-visible,
.glc-btn:focus-visible,
.glc-radio input:focus-visible {
	outline: 3px solid var(--glc-primary);
	outline-offset: 1px;
	border-color: var(--glc-primary);
}

.glc-input-icon {
	position: relative;
}

.glc-input-icon .glc-input {
	padding-left: 2.1rem;
}

.glc-input-icon__icon {
	position: absolute;
	left: 0.7rem;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.6;
	pointer-events: none;
	font-size: 0.95em;
}

.glc-hint {
	margin: 0.3rem 0 0;
	font-size: 0.8em;
	opacity: 0.7;
}

.glc-error {
	margin: 0.3rem 0 0;
	font-size: 0.8em;
	color: #b3261e;
	min-height: 1em;
}

.glc-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
}

.glc-radio {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 500;
	font-size: 0.9em;
	cursor: pointer;
}

/* Actions */
.glc-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1rem;
	flex-wrap: wrap;
}

.glc-btn {
	appearance: none;
	border: 2px solid var(--glc-button);
	border-radius: calc(var(--glc-radius) * 0.6);
	padding: 0.65rem 1.4rem;
	font-size: 0.95em;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.1s ease, opacity 0.15s ease;
}

.glc-btn--primary {
	background: var(--glc-button);
	color: #fff;
}

.glc-btn--secondary {
	background: transparent;
	color: var(--glc-button);
}

.glc-btn:hover {
	opacity: 0.9;
}

.glc-btn:active {
	transform: scale(0.98);
}

/* Results */
.glc-results {
	background: #fff;
	border: 1px solid #e4e4e7;
	border-radius: var(--glc-radius);
	padding: 1.25rem;
}

.glc-theme-dark .glc-results {
	background: #232323;
	border-color: #333;
}

.glc-results--elevated {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	border: none;
}

.glc-results--outlined {
	border: 2px solid var(--glc-primary);
}

.glc-results__title {
	margin: 0 0 1rem;
	font-size: 1.1em;
}

.glc-results__hero {
	background: linear-gradient(135deg, var(--glc-primary), var(--glc-secondary));
	color: #fff;
	border-radius: calc(var(--glc-radius) * 0.7);
	padding: 1.1rem 1.3rem;
	margin-bottom: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.glc-results__hero-label {
	font-size: 0.85em;
	opacity: 0.85;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.glc-results__hero-value {
	font-size: 1.9em;
	font-weight: 800;
	word-break: break-word;
}

.glc-results__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem 1.25rem;
	margin: 0 0 1.25rem;
}

@media (min-width: 620px) {
	.glc-results__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 900px) {
	.glc-results__grid {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

.glc-results__item {
	background: rgba(184, 134, 11, 0.06);
	border-radius: calc(var(--glc-radius) * 0.5);
	padding: 0.65rem 0.8rem;
}

.glc-results__item dt {
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	opacity: 0.7;
	margin: 0 0 0.25rem;
}

.glc-results__item dd {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
}

/* Chart */
.glc-chart-wrap {
	margin: 1rem 0 1.25rem;
}

.glc-chart-wrap__title {
	font-size: 0.9em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.7;
	margin: 0 0 0.5rem;
}

.glc-chart {
	width: 100%;
	height: 160px;
	display: block;
	border-radius: calc(var(--glc-radius) * 0.4);
}

.glc-chart-legend {
	list-style: none;
	margin: 0.7rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
}

.glc-chart-legend__item {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85em;
}

.glc-chart-legend__swatch {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
	flex-shrink: 0;
}

/* Disclaimer */
.glc-disclaimer {
	font-size: 0.78em;
	opacity: 0.65;
	margin: 0;
	line-height: 1.5;
	border-top: 1px dashed #d4d4d8;
	padding-top: 0.75rem;
}

/* Small-screen refinements */
@media (max-width: 480px) {
	.glc-field--inline {
		grid-template-columns: 1fr;
	}

	.glc-results__hero-value {
		font-size: 1.5em;
	}

	.glc-actions {
		flex-direction: column;
	}

	.glc-btn {
		width: 100%;
	}
}
