/**
 * Trade Flow — Frontend Styles
 *
 * Styles for the application form and status display.
 *
 * @package BloomStack\TradeFlow
 * @since 1.2.0
 */

/* ==========================================================================
   Material Symbols Rounded — Self-hosted variable font (Apache 2.0)
   ========================================================================== */

@font-face {
	font-family: 'Material Symbols Rounded';
	font-style: normal;
	font-weight: 100 700;
	font-display: block;
	src: url('../fonts/MaterialSymbolsRounded.woff2?v=1.0.0') format('woff2');
}

.material-symbols-rounded {
	font-family: 'Material Symbols Rounded';
	font-weight: normal;
	font-style: normal;
	font-size: 20px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
}

/* ==========================================================================
   Application Form
   ========================================================================== */

.tf-application-form-wrap {
	max-width: 640px;
}

.tf-hp-field {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
	opacity: 0;
}

.tf-form-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
}

.tf-form-field {
	margin-bottom: 20px;
	width: 100%;
	box-sizing: border-box;
}

.tf-form-field[data-field-width="full"] {
	width: 100%;
}

.tf-form-field[data-field-width="half"] {
	width: calc(50% - 10px);
}

.tf-step-break {
	display: none;
}

/* ==========================================================================
   Multi-Step Form
   ========================================================================== */

.tf-form-step {
	display: none;
}

.tf-form-step.tf-step-active {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
}

.tf-step-title {
	width: 100%;
	margin: 0 0 20px;
	font-size: 18px;
	font-weight: 600;
	color: #1F2937;
}

@keyframes tfFadeInUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.tf-form-step.tf-step-fade-in {
	animation: tfFadeInUp 0.3s ease forwards;
}

/* ==========================================================================
   Step Indicator
   ========================================================================== */

.tf-step-indicator {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0;
	margin-bottom: 32px;
	padding: 0;
}

.tf-step-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
}

.tf-step-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 600;
	color: #1F2937;
	background: transparent;
	border: 2px solid #1F2937;
	transition: all 0.2s ease;
}

.tf-step-label {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
	color: #6B7280;
	text-align: center;
	max-width: 120px;
	line-height: 1.3;
	transition: color 0.2s ease;
}

.tf-step-item--active .tf-step-dot {
	color: #FFFFFF;
	background: #1F2937;
	border-color: #1F2937;
}

.tf-step-item--active .tf-step-label {
	color: #1F2937;
	font-weight: 600;
}

.tf-step-item--completed .tf-step-dot {
	color: #FFFFFF;
	background: #1F2937;
	border-color: #1F2937;
}

.tf-step-item--completed .tf-step-label {
	color: #1F2937;
}

.tf-step-connector {
	height: 2px;
	width: 48px;
	background: #D1D5DB;
	margin-top: 17px;
	flex-shrink: 0;
	transition: background 0.2s ease;
}

.tf-step-connector.tf-step-connector--completed {
	background: #1F2937;
}

/* ==========================================================================
   Step Navigation Buttons
   ========================================================================== */

.tf-form-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 28px;
	gap: 12px;
}

.tf-form-button--back {
	background: #F3F4F6;
	color: #374151;
	border: 1px solid #E5E7EB;
}

.tf-form-button--back:hover {
	background: #E5E7EB;
}

.tf-form-button--next,
#tf-submit-btn {
	margin-left: auto;
}

.tf-form-button--next {
	background: #374151;
}

.tf-form-button--next:hover {
	background: #1F2937;
}

/* ==========================================================================
   Live Validation States
   ========================================================================== */

.tf-form-field.tf-field-valid .tf-form-input,
.tf-form-field.tf-field-valid .tf-form-textarea,
.tf-form-field.tf-field-valid .tf-form-select {
	border-color: #10B981;
}

.tf-form-field.tf-field-valid .tf-form-input:focus,
.tf-form-field.tf-field-valid .tf-form-textarea:focus,
.tf-form-field.tf-field-valid .tf-form-select:focus {
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.tf-form-field.tf-field-invalid .tf-form-input,
.tf-form-field.tf-field-invalid .tf-form-textarea,
.tf-form-field.tf-field-invalid .tf-form-select {
	border-color: #EF4444;
}

.tf-form-field.tf-field-invalid .tf-form-input:focus,
.tf-form-field.tf-field-invalid .tf-form-textarea:focus,
.tf-form-field.tf-field-invalid .tf-form-select:focus {
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tf-field-input-wrap {
	position: relative;
}

.tf-field-icon {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	width: 20px;
	height: 20px;
	pointer-events: none;
	line-height: 1;
}

.tf-field-valid .tf-field-icon {
	color: #10B981;
}

.tf-field-invalid .tf-field-icon {
	color: #EF4444;
}

.tf-field-error-message {
	display: none;
	margin-top: 4px;
	font-size: 12px;
	color: #EF4444;
	line-height: 1.4;
}

.tf-field-invalid .tf-field-error-message {
	display: block;
}

.tf-field-valid .tf-field-error-message {
	display: none;
}

.tf-form-field.tf-field-valid .tf-form-input,
.tf-form-field.tf-field-valid .tf-form-select {
	padding-right: 36px;
}

.tf-form-field.tf-field-invalid .tf-form-input,
.tf-form-field.tf-field-invalid .tf-form-select {
	padding-right: 36px;
}

/* ==========================================================================
   Responsive — Half-Width Collapse
   ========================================================================== */

@media (max-width: 480px) {
	.tf-form-field[data-field-width="half"] {
		width: 100%;
	}

	.tf-step-connector {
		width: 20px;
	}

	.tf-step-dot {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}

	.tf-step-label {
		font-size: 11px;
		max-width: 80px;
	}
}

.tf-form-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: #1F2937;
}

.tf-form-label--sub {
	font-weight: 500;
	font-size: 13px;
	margin-top: 10px;
	color: #6B7280;
}

.tf-required {
	color: #EF4444;
}

.tf-form-input,
.tf-form-textarea,
.tf-form-select {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	background: #FFFFFF;
	color: #1F2937;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.tf-form-input:focus,
.tf-form-textarea:focus,
.tf-form-select:focus {
	border-color: #7C3AED;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
	outline: none;
}

.tf-form-textarea {
	resize: vertical;
	min-height: 100px;
}

.tf-form-radio-group,
.tf-form-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tf-form-radio-label,
.tf-form-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #1F2937;
	cursor: pointer;
}

.tf-form-file {
	font-size: 14px;
}

.tf-form-help {
	margin: 6px 0 0;
	font-size: 12px;
	color: #6B7280;
}

.tf-cohort-other-wrap {
	margin-top: 10px;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.tf-form-button {
	display: inline-block;
	padding: 12px 32px;
	font-size: 15px;
	font-weight: 600;
	color: #FFFFFF;
	background: #7C3AED;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.tf-form-button:hover {
	background: #6D28D9;
}

.tf-form-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ==========================================================================
   Form Messages
   ========================================================================== */

.tf-form-messages {
	margin-top: 20px;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.tf-form-messages p {
	margin: 0;
}

.tf-form-messages--success {
	background: #D1FAE5;
	color: #065F46;
	border-left: 4px solid #10B981;
}

.tf-form-messages--error {
	background: #FEE2E2;
	color: #991B1B;
	border-left: 4px solid #EF4444;
}

/* ==========================================================================
   Application Status (Frontend)
   ========================================================================== */

.tf-application-notice {
	padding: 20px 24px;
	border-radius: 8px;
	border-left: 4px solid;
	margin-bottom: 20px;
}

.tf-application-notice h3 {
	margin: 0 0 8px;
	font-size: 16px;
}

.tf-application-notice p {
	margin: 0;
	line-height: 1.6;
}

.tf-application-notice--info {
	background: #DBEAFE;
	color: #1E40AF;
	border-left-color: #3B82F6;
}

.tf-application-notice--success {
	background: #D1FAE5;
	color: #065F46;
	border-left-color: #10B981;
}

.tf-application-notice--warning {
	background: #FEF3C7;
	color: #92400E;
	border-left-color: #F59E0B;
}

.tf-application-status-date {
	margin-top: 8px !important;
	font-size: 13px;
	opacity: 0.8;
}

/* ==========================================================================
   Trade Price Display
   ========================================================================== */

.tf-trade-price-wrap {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
}

.tf-original-price {
	color: #9CA3AF;
	text-decoration: line-through;
	font-size: 0.9em;
}

.tf-original-price .woocommerce-Price-amount {
	color: inherit;
}

.tf-trade-price {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.tf-trade-price-label {
	font-size: 0.85em;
	font-weight: 600;
	color: #7C3AED;
	white-space: nowrap;
}

.tf-trade-price-amount {
	text-decoration: none;
	font-weight: 600;
	color: #1F2937;
}

.tf-trade-price-amount .woocommerce-Price-amount {
	color: inherit;
}

ul.products .tf-trade-price-wrap {
	flex-direction: column;
	gap: 2px;
}

.single-product .tf-trade-price-wrap {
	gap: 8px;
}

.single-product .tf-trade-price-label {
	font-size: 0.9em;
}

.single-product .tf-trade-price-amount {
	font-size: 1.1em;
}

/* ==========================================================================
   Trade Dashboard (My Account)
   ========================================================================== */

.tf-dashboard {
	max-width: 800px;
}

.tf-dashboard-section {
	margin-bottom: 32px;
}

.tf-dashboard-section h3 {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 600;
	color: #1F2937;
}

.tf-dashboard-summary-table th {
	width: 180px;
	font-weight: 500;
	color: #6B7280;
}

.tf-dashboard-badge {
	display: inline-block;
	padding: 3px 10px;
	font-size: 13px;
	font-weight: 600;
	color: #7C3AED;
	background: #EDE9FE;
	border-radius: 4px;
}

.tf-dashboard-discount {
	font-weight: 600;
	color: #059669;
}

.tf-dashboard-orders-table th {
	font-size: 13px;
	font-weight: 600;
	color: #6B7280;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.tf-dashboard-orders-table td {
	vertical-align: middle;
}

.tf-dashboard-orders-table .button.view {
	padding: 4px 12px;
	font-size: 13px;
}

.tf-dashboard-application-status {
	max-width: 640px;
}

/* ==========================================================================
   Checkout Trade Savings Row
   ========================================================================== */

.tf-checkout-savings {
	color: #059669;
	font-weight: 600;
}

.tf-block-checkout-savings {
	display: block;
	color: #6B7280;
	font-size: inherit;
	font-weight: normal;
}
