/**
 * [B] License Manager - Frontend Styles
 *
 * @package BDW_License_Manager
 * @since   1.0.0
 */

/* ===== General Reset ===== */
.bdw-lm-dashboard,
.bdw-lm-checkout {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #1d2327;
	line-height: 1.6;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 0;
}

.bdw-lm-dashboard *,
.bdw-lm-checkout * {
	box-sizing: border-box;
}

/* ===== Buttons ===== */
.bdw-lm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	line-height: 1.4;
}

.bdw-lm-btn:hover {
	text-decoration: none;
}

.bdw-lm-btn:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.bdw-lm-btn-primary {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

.bdw-lm-btn-primary:hover {
	background: #005a87;
	color: #fff;
}

.bdw-lm-btn-outline {
	background: transparent;
	color: #0073aa;
	border-color: #0073aa;
}

.bdw-lm-btn-outline:hover {
	background: #0073aa;
	color: #fff;
}

.bdw-lm-btn-danger {
	background: transparent;
	color: #dc3545;
	border-color: #dc3545;
}

.bdw-lm-btn-danger:hover {
	background: #dc3545;
	color: #fff;
}

.bdw-lm-btn-small {
	padding: 4px 10px;
	font-size: 12px;
}

.bdw-lm-btn-full {
	width: 100%;
}

.bdw-lm-btn-large {
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
}

.bdw-lm-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.bdw-lm-btn.bdw-lm-btn-primary.bdw-lm-btn-full.bdw-lm-btn-large {
    background-color: #1d356d;
    border: 1px solid #0f172a;
    border-radius: 3px;
    color: #ffd300;
    display: inline-block;
    font-size: 1rem;
    font-weight: 400;
    padding: .5rem 1rem;
    text-align: center;
    transition: all .3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    white-space: nowrap;
}

/* ===== Notices ===== */
.bdw-lm-notice {
	padding: 16px 20px;
	border-radius: 8px;
	margin-bottom: 24px;
}

.bdw-lm-notice-success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.bdw-lm-notice-warning {
	background: #fff3cd;
	border: 1px solid #ffeeba;
	color: #856404;
}

.bdw-lm-notice-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

/* ===== Dashboard ===== */
.bdw-lm-dashboard-header {
	margin-bottom: 24px;
}

.bdw-lm-dashboard-header h2 {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 8px;
}

.bdw-lm-welcome {
	color: #646970;
	font-size: 15px;
	margin: 0;
}

.bdw-lm-empty-state {
	text-align: center;
	padding: 60px 20px;
	background: #f9f9f9;
	border-radius: 12px;
	border: 2px dashed #ddd;
}

.bdw-lm-empty-state p {
	color: #646970;
	font-size: 16px;
	margin-bottom: 16px;
}

.bdw-lm-login-notice {
	text-align: center;
	padding: 40px 20px;
	background: #f0f6fc;
	border-radius: 12px;
	border: 1px solid #c5d9ed;
}

/* ===== License Cards ===== */
.bdw-lm-licenses-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.bdw-lm-license-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 24px;
	transition: box-shadow 0.2s ease;
}

.bdw-lm-license-card:hover {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.bdw-lm-license-inactive {
	opacity: 0.75;
	border-color: #f5c6cb;
}

.bdw-lm-license-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 16px;
}

.bdw-lm-license-product h3 {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
}

.bdw-lm-license-version {
	color: #646970;
	font-size: 13px;
	background: #f0f0f1;
	padding: 2px 8px;
	border-radius: 4px;
}

/* Badges */
.bdw-lm-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-right: 6px;
}

.bdw-lm-badge-active {
	background: #d4edda;
	color: #155724;
}

.bdw-lm-badge-expired {
	background: #f8d7da;
	color: #721c24;
}

.bdw-lm-badge-suspended {
	background: #fff3cd;
	color: #856404;
}

.bdw-lm-badge-canceled {
	background: #e2e3e5;
	color: #383d41;
}

.bdw-lm-badge-type {
	background: #cce5ff;
	color: #004085;
}

/* License Key Row */
.bdw-lm-license-key-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #f8f9fa;
	border-radius: 8px;
	margin-bottom: 16px;
}

.bdw-lm-license-key-row label {
	font-weight: 600;
	font-size: 13px;
	color: #646970;
	white-space: nowrap;
}

.bdw-lm-key-display {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
}

.bdw-lm-license-key-text {
	font-size: 14px;
	letter-spacing: 1px;
	padding: 4px 8px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	user-select: all;
}

/* License Details Grid */
.bdw-lm-license-details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.bdw-lm-detail-item {
	display: flex;
	flex-direction: column;
}

.bdw-lm-detail-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #646970;
}

.bdw-lm-detail-value {
	font-size: 15px;
	font-weight: 500;
	color: #1d2327;
}

/* Domains Section */
.bdw-lm-domains-section {
	border-top: 1px solid #eee;
	padding-top: 16px;
	margin-top: 8px;
}

.bdw-lm-domains-section h4 {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
}

.bdw-lm-no-domains {
	color: #646970;
	font-size: 13px;
	font-style: italic;
}

.bdw-lm-domains-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bdw-lm-domain-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: #f8f9fa;
	border-radius: 6px;
	flex-wrap: wrap;
}

.bdw-lm-domain-item code {
	font-size: 14px;
	font-weight: 500;
	flex: 1;
}

.bdw-lm-domain-date {
	font-size: 12px;
	color: #646970;
}

.bdw-lm-domain-actions {
	display: flex;
	gap: 6px;
}

/* Change Domain Form */
.bdw-lm-change-domain-form {
	margin-top: 12px;
	padding: 16px;
	background: #f0f6fc;
	border-radius: 8px;
	border: 1px solid #c5d9ed;
}

.bdw-lm-change-domain-form h4 {
	margin: 0 0 12px;
}

.bdw-lm-form-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.bdw-lm-form-row label {
	font-weight: 600;
	font-size: 13px;
}

.bdw-lm-new-domain-input {
	flex: 1;
	min-width: 200px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
}

.bdw-lm-new-domain-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Subscription Actions */
.bdw-lm-subscription-actions {
	border-top: 1px solid #eee;
	padding-top: 16px;
	margin-top: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.bdw-lm-cancel-note {
	color: #646970;
	font-size: 12px;
}

/* ===== Checkout ===== */
.bdw-lm-checkout h2 {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 20px;
}

/* Product Grid */
.bdw-lm-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.bdw-lm-product-card {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 12px;
	padding: 24px;
	text-align: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bdw-lm-product-card:hover {
	border-color: #0073aa;
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.12);
}

.bdw-lm-product-icon {
	width: 64px;
	height: 64px;
	border-radius: 12px;
	margin-bottom: 12px;
}

.bdw-lm-product-card h3 {
	margin: 0 0 8px;
	font-size: 20px;
}

.bdw-lm-product-desc {
	color: #646970;
	font-size: 14px;
	margin: 0 0 8px;
}

.bdw-lm-product-version {
	font-size: 12px;
	color: #999;
	margin-bottom: 16px;
}

/* License Type Toggle */
.bdw-lm-type-toggle {
	display: flex;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 16px;
}

.bdw-lm-type-btn {
	flex: 1;
	padding: 8px 12px;
	background: #f8f9fa;
	border: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.2s ease;
	color: #646970;
}

.bdw-lm-type-btn:first-child {
	border-right: 1px solid #ddd;
}

.bdw-lm-type-btn.active {
	background: #0073aa;
	color: #fff;
}

.bdw-lm-type-btn:hover:not(.active) {
	background: #e9ecef;
}

.bdw-lm-type-btn:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: -2px;
}

/* Pricing Options */
.bdw-lm-pricing-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.bdw-lm-pricing-option {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.bdw-lm-pricing-option:hover {
	border-color: #0073aa;
}

.bdw-lm-pricing-option-disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.bdw-lm-pricing-option-disabled:hover {
	border-color: #e0e0e0;
}

.bdw-lm-pricing-option input[type="radio"] {
	margin-right: 12px;
	width: 18px;
	height: 18px;
}

.bdw-lm-pricing-option input[type="radio"]:checked + .bdw-lm-pricing-label {
	color: #0073aa;
}

.bdw-lm-pricing-option:has(input:checked) {
	border-color: #0073aa;
	background: #f0f6fc;
}

.bdw-lm-pricing-label {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
}

.bdw-lm-pricing-period {
	font-weight: 600;
	font-size: 14px;
}

.bdw-lm-pricing-amount {
	font-size: 18px;
	font-weight: 700;
	margin-left: auto;
}

.bdw-lm-pricing-save {
	background: #00a32a;
	color: #fff;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}

.bdw-lm-pricing-note {
	font-size: 11px;
	color: #646970;
}

/* Checkout Form */
.bdw-lm-checkout-form {
	max-width: 600px;
	margin: 0 auto;
}

.bdw-lm-checkout-summary {
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 24px;
}

.bdw-lm-checkout-summary h3 {
	margin: 0 0 12px;
	font-size: 16px;
}

.bdw-lm-checkout-summary div {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
}

.bdw-lm-summary-total {
	border-top: 2px solid #ddd;
	margin-top: 8px;
	padding-top: 12px !important;
	font-weight: 700;
	font-size: 18px !important;
}

.bdw-lm-form-group {
	margin-bottom: 16px;
}

.bdw-lm-form-group label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
}

.bdw-lm-form-group input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-size: 15px;
}

.bdw-lm-form-group input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* Gateway Selection */
.bdw-lm-gateway-selection {
	margin-bottom: 24px;
}

.bdw-lm-gateway-selection > label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 10px;
}

.bdw-lm-gateway-options {
	display: flex;
	gap: 12px;
}

.bdw-lm-gateway-option {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.bdw-lm-gateway-option:hover {
	border-color: #0073aa;
}

.bdw-lm-gateway-option:has(input:checked) {
	border-color: #0073aa;
	background: #f0f6fc;
}

.bdw-lm-gateway-option input[type="radio"] {
	margin-right: 8px;
}

.bdw-lm-gateway-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 15px;
}

.bdw-lm-gateway-label .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Processing State */
.bdw-lm-checkout-processing {
	text-align: center;
	padding: 30px;
}

.bdw-lm-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #e0e0e0;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: bdw-spin 0.8s linear infinite;
	margin: 0 auto 16px;
}

@keyframes bdw-spin {
	to {
		transform: rotate(360deg);
	}
}

.bdw-lm-checkout-back {
	text-align: center;
	margin-top: 16px;
}

.bdw-lm-checkout-back a {
	color: #646970;
	text-decoration: none;
}

.bdw-lm-checkout-back a:hover {
	color: #0073aa;
}

/* ===== Checkout Login Section ===== */
.bdw-lm-checkout-login-section {
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.bdw-lm-login-toggle {
	margin: 0;
	font-size: 14px;
	color: #646970;
}

.bdw-lm-login-toggle a {
	color: #0073aa;
	text-decoration: none;
	font-weight: 500;
}

.bdw-lm-login-toggle a:hover {
	text-decoration: underline;
}

.bdw-lm-login-fields {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e0e0e0;
}

.bdw-lm-login-fields .bdw-lm-form-group {
	margin-bottom: 12px;
}

.bdw-lm-login-fields .bdw-lm-form-group:last-of-type {
	margin-bottom: 16px;
}

.bdw-lm-login-error {
	margin: 8px 0 0;
	font-size: 13px;
}

/* Form description text */
.bdw-lm-form-group .description {
	font-size: 13px;
	color: #646970;
	margin-top: 6px;
	font-style: italic;
}

/* ===== Single Product Mode ===== */
.bdw-lm-single-product-options {
	margin-bottom: 24px;
}

.bdw-lm-single-product-options .bdw-lm-type-toggle {
	margin-bottom: 16px;
}

.bdw-lm-single-product-options .bdw-lm-pricing-options {
	margin-bottom: 0;
}

/* Adjust checkout form when in single product mode */
.bdw-lm-checkout-form[data-auto-select="true"] {
	max-width: 600px;
	margin: 0 auto;
}

.bdw-lm-checkout-form[data-auto-select="true"] h2 {
	font-size: 22px;
	margin-bottom: 24px;
	text-align: center;
}

.bdw-lm-checkout-form[data-auto-select="true"] .bdw-lm-checkout-back {
	display: none;
}

/* Hide product selection grid when in single product mode */
.bdw-lm-checkout-products[data-single-product="true"] {
	display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
	.bdw-lm-product-grid {
		grid-template-columns: 1fr;
	}

	.bdw-lm-license-header {
		flex-direction: column;
		gap: 8px;
	}

	.bdw-lm-license-details {
		grid-template-columns: 1fr 1fr;
	}

	.bdw-lm-domain-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.bdw-lm-domain-actions {
		width: 100%;
	}

	.bdw-lm-gateway-options {
		flex-direction: column;
	}

	.bdw-lm-form-row {
		flex-direction: column;
		align-items: stretch;
	}

	.bdw-lm-subscription-actions {
		flex-direction: column;
		align-items: flex-start;
	}

	.bdw-lm-license-key-row {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ===== Missing Badge Variants ===== */
.bdw-lm-badge-past_due {
	background: #fff3cd;
	color: #856404;
}

.bdw-lm-badge-revoked {
	background: #f8d7da;
	color: #721c24;
}

.bdw-lm-badge-trial {
	background: #d1ecf1;
	color: #0c5460;
}

.bdw-lm-badge-completed {
	background: #d4edda;
	color: #155724;
}

.bdw-lm-badge-pending {
	background: #e2e3e5;
	color: #383d41;
}

.bdw-lm-badge-failed {
	background: #f8d7da;
	color: #721c24;
}

/* ===== Renewal CTA ===== */
.bdw-lm-renewal-cta {
	margin-top: 12px;
	padding: 14px 16px;
	background: #fff8e1;
	border-left: 3px solid #f0a500;
	border-radius: 6px;
}

.bdw-lm-renewal-cta p {
	margin: 0 0 8px;
	font-weight: 600;
	font-size: 14px;
	color: #7a5e00;
}

/* ===== Upgrade Section ===== */
.bdw-lm-upgrade-section {
	margin-top: 12px;
}

.bdw-lm-upgrade-section summary {
	cursor: pointer;
	font-size: 13px;
	color: #0073aa;
	font-weight: 500;
	user-select: none;
}

.bdw-lm-upgrade-section summary:hover {
	color: #005a87;
}

.bdw-lm-upgrade-options {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* ===== Payment History ===== */
.bdw-lm-payment-history-section {
	margin-top: 12px;
}

.bdw-lm-payment-history-section summary {
	cursor: pointer;
	font-size: 13px;
	color: #0073aa;
	font-weight: 500;
	user-select: none;
}

.bdw-lm-payment-history-section summary:hover {
	color: #005a87;
}

.bdw-lm-payment-history-body {
	margin-top: 8px;
}

.bdw-lm-payment-history-body table {
	width: 100%;
	font-size: 12px;
	border-collapse: collapse;
}

.bdw-lm-payment-history-body th {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid #ddd;
	font-weight: 600;
	color: #646970;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.bdw-lm-payment-history-body td {
	padding: 6px 8px;
	border-bottom: 1px solid #f0f0f1;
}

.bdw-lm-payment-history-body tr:last-child td {
	border-bottom: none;
}

.bdw-lm-loading {
	font-size: 12px;
	color: #999;
	font-style: italic;
}

/* ===== Account Section ===== */
.bdw-lm-account-section {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #e0e0e0;
}

.bdw-lm-account-section h3 {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 600;
}

.bdw-lm-account-email {
	font-size: 14px;
	color: #1d2327;
	margin: 0 0 12px;
}

.bdw-lm-account-section > details {
	margin-top: 12px;
}

.bdw-lm-account-section > details > summary {
	cursor: pointer;
	color: #0073aa;
	font-weight: 500;
	user-select: none;
}

.bdw-lm-account-section > details > summary:hover {
	color: #005a87;
}

/* Change Password Form */
.bdw-lm-change-password-form {
	margin-top: 16px;
	max-width: 360px;
}

.bdw-lm-change-password-form label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 4px;
	color: #1d2327;
}

.bdw-lm-change-password-form input[type="password"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 12px;
}

.bdw-lm-change-password-form input[type="password"]:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.bdw-lm-pw-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.bdw-lm-pw-msg {
	font-size: 13px;
	transition: color 0.2s;
}

/* ===== Copy Key Feedback ===== */
.bdw-lm-copy-key.bdw-lm-copied {
	background: #d4edda;
	color: #155724;
	border-color: #c3e6cb;
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
	.bdw-lm-spinner {
		animation: none;
	}

	.bdw-lm-btn,
	.bdw-lm-product-card,
	.bdw-lm-license-card,
	.bdw-lm-pricing-option,
	.bdw-lm-gateway-option {
		transition: none;
	}
}

/* High contrast focus styles */
.bdw-lm-dashboard :focus-visible,
.bdw-lm-checkout :focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}
