/**
 * Frontend styles for Faraid Calculator Basic.
 *
 * Loaded only on singular pages/posts whose content contains the
 * [faraid_calculator] shortcode. Styles the shortcode's container only;
 * contains no calculator field styling, as no fields exist in this phase.
 */

.fcb-frontend-wrap {
	max-width: 720px;
	margin: 0 auto;
	padding: 24px;
	box-sizing: border-box;
	font-size: 16px;
	line-height: 1.6;
}

.fcb-frontend-wrap * {
	box-sizing: inherit;
}

.fcb-frontend-header {
	margin-bottom: 20px;
	text-align: center;
}

.fcb-frontend-title {
	margin: 0 0 8px;
	font-size: 1.75em;
}

.fcb-frontend-description {
	margin: 0;
	color: #50575e;
}

.fcb-calculator-container {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 24px;
	text-align: center;
}

.fcb-calculator-container {
	text-align: left;
}

.fcb-calculator-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.fcb-form-section {
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px 20px 20px;
	margin: 0;
}

.fcb-section-title {
	font-size: 1em;
	font-weight: 600;
	padding: 0 6px;
}

.fcb-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 12px;
}

.fcb-form-row:first-of-type {
	margin-top: 4px;
}

.fcb-form-field {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fcb-form-field label,
.fcb-field-label {
	font-weight: 600;
	font-size: 0.95em;
}

.fcb-required {
	color: #d63638;
}

.fcb-input,
.fcb-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 1em;
	background: #ffffff;
	box-sizing: border-box;
}

.fcb-input:focus,
.fcb-select:focus {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

.fcb-radio-group {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 4px;
}

.fcb-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
	cursor: pointer;
}

.fcb-form-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.fcb-btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 4px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	text-decoration: none;
}

.fcb-btn-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #ffffff;
}

.fcb-btn-primary:hover {
	background: #135e96;
	border-color: #135e96;
}

.fcb-btn-secondary {
	background: #f6f7f7;
	border-color: #8c8f94;
	color: #1d2327;
}

.fcb-btn-secondary:hover {
	background: #f0f0f1;
}

/* ---------------------------------------------------------------------
 * Validation Notices (Package P06)
 * Presentation only. Styles the error/success notices and inline field
 * errors produced by FormProcessor/Validator; contains no validation
 * logic itself.
 * ------------------------------------------------------------------- */

.fcb-notice {
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 16px;
	border: 1px solid transparent;
}

.fcb-notice p {
	margin: 0;
}

.fcb-notice p + p {
	margin-top: 6px;
}

.fcb-notice-success {
	background: #edfaef;
	border-color: #68de7c;
	color: #1a4d20;
}

.fcb-notice-error {
	background: #fcf0f1;
	border-color: #d63638;
	color: #7a1418;
}

.fcb-notice-title {
	font-weight: 600;
}

.fcb-error-list {
	margin: 6px 0 0;
	padding-left: 20px;
}

.fcb-error-list li {
	margin-bottom: 4px;
}

.fcb-field-error {
	display: block;
	color: #d63638;
	font-size: 0.85em;
	font-weight: 400;
}

.fcb-section-error {
	margin: 4px 0 12px;
	font-weight: 600;
}

/* ---------------------------------------------------------------------
 * Results UI (Package P09)
 * Presentation only. Displays the data prepared by ResultsController;
 * contains no calculation or validation logic itself. Supersedes the
 * temporary Rules Engine debug panel used in Packages P07–P08.
 * ------------------------------------------------------------------- */

.fcb-results-section {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #dcdcde;
}

.fcb-results-heading {
	margin: 0 0 14px;
	font-size: 1.2em;
}

.fcb-results-subheading {
	margin: 0 0 10px;
	font-size: 1em;
	font-weight: 600;
}

.fcb-results-empty {
	margin: 0;
	color: #50575e;
	font-style: italic;
}

.fcb-results-notice {
	border-radius: 4px;
	padding: 12px 16px;
	margin: 0;
}

.fcb-results-notice p {
	margin: 0;
}

.fcb-results-notice-warning {
	background: #fcf9e8;
	border: 1px solid #dba617;
	color: #5a4600;
}

.fcb-results-summary {
	margin-bottom: 20px;
}

.fcb-summary-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.fcb-summary-item {
	flex: 1 1 200px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 10px 14px;
}

.fcb-summary-item dt {
	margin: 0 0 4px;
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #50575e;
}

.fcb-summary-item dd {
	margin: 0;
	font-size: 1.1em;
	font-weight: 600;
}

.fcb-results-table-wrap {
	margin-bottom: 16px;
}

.fcb-results-table {
	width: 100%;
	border-collapse: collapse;
	background: #ffffff;
}

.fcb-results-table th,
.fcb-results-table td {
	border: 1px solid #dcdcde;
	padding: 8px 10px;
	text-align: left;
	font-size: 0.95em;
}

.fcb-results-table th {
	background: #f6f7f7;
	font-weight: 600;
}

.fcb-results-remaining-row {
	font-style: italic;
	color: #50575e;
}

.fcb-results-actions {
	margin-top: 12px;
}

@media screen and (max-width: 768px) {
	.fcb-frontend-wrap {
		padding: 16px;
		font-size: 15px;
	}

	.fcb-frontend-title {
		font-size: 1.4em;
	}

	.fcb-calculator-container {
		padding: 16px;
	}

	.fcb-form-row {
		flex-direction: column;
		gap: 12px;
	}

	.fcb-form-actions {
		flex-direction: column;
	}

	.fcb-btn {
		width: 100%;
	}

	.fcb-results-table thead {
		display: none;
	}

	.fcb-results-table,
	.fcb-results-table tbody,
	.fcb-results-table tr,
	.fcb-results-table td {
		display: block;
		width: 100%;
	}

	.fcb-results-table tr {
		margin-bottom: 12px;
		border: 1px solid #dcdcde;
		border-radius: 6px;
		padding: 4px 10px;
	}

	.fcb-results-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 8px;
		border: none;
		border-bottom: 1px solid #f0f0f1;
		padding: 8px 0;
	}

	.fcb-results-table td:last-child {
		border-bottom: none;
	}

	.fcb-results-table td::before {
		content: attr(data-label);
		font-weight: 600;
		margin-right: 8px;
	}
}

@media print {
	.fcb-calculator-form,
	.fcb-no-print {
		display: none !important;
	}
}
