/**
 * Zest Account Styles
 *
 * Styles for the [zest_account] shortcode area including
 * the email verification form, result states, purchases list,
 * license cards, and account wrapper.
 *
 * @package BloomStack\Zest
 * @since 1.1.0
 * @since 1.2.0 Added purchases and license card styles.
 */

/* ==========================================================================
   Account Container
   ========================================================================== */

.zest-account {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
	color: var(--zest-text-body, #4B5563);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.zest-account--wide {
	max-width: 100%;
}

/* ==========================================================================
   Verify Email Form
   ========================================================================== */

.zest-verify {
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 12px;
	padding: 40px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.zest-verify__header {
	text-align: center;
	margin-bottom: 32px;
}

.zest-verify__title {
	margin: 0 0 12px;
	font-size: 24px;
	font-weight: 700;
	color: var(--zest-text-dark, #1F2937);
	line-height: 1.3;
}

.zest-verify__description {
	margin: 0;
	font-size: 15px;
	color: var(--zest-text-body, #4B5563);
}

/* Form Fields */

.zest-verify__field {
	margin-bottom: 24px;
}

.zest-verify__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

.zest-verify__input {
	display: block;
	width: 100%;
	padding: 12px 16px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--zest-text-dark, #1F2937);
	background-color: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.zest-verify__input:focus {
	border-color: var(--zest-primary, #7C3AED);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.zest-verify__input::placeholder {
	color: #9CA3AF;
}

.zest-verify__help {
	margin: 6px 0 0;
	font-size: 13px;
	color: #9CA3AF;
}

/* Honeypot — hidden from real users */

.zest-verify__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* Submit Button */

.zest-verify__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 14px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #FFFFFF;
	background-color: var(--zest-accent, #F97316);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.2s ease, transform 0.1s ease;
	line-height: 1.5;
	box-sizing: border-box;
}

.zest-verify__submit:hover {
	background-color: var(--zest-accent-hover, #EA580C);
}

.zest-verify__submit:active {
	transform: scale(0.98);
}

.zest-verify__submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.zest-verify__submit--loading .zest-verify__submit-text {
	visibility: hidden;
}

.zest-verify__submit--loading .zest-verify__spinner {
	display: block;
}

/* Spinner */

.zest-verify__spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #FFFFFF;
	border-radius: 50%;
	animation: zest-spin 0.6s linear infinite;
	position: absolute;
}

.zest-verify__spinner--active {
	display: block;
	position: static;
	border-color: rgba(124, 58, 237, 0.2);
	border-top-color: var(--zest-primary, #7C3AED);
}

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

/* ==========================================================================
   Messages (Success / Error)
   ========================================================================== */

.zest-verify__messages:empty {
	display: none;
}

.zest-message {
	padding: 14px 16px;
	margin-bottom: 20px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.zest-message--success {
	background-color: #D1FAE5;
	color: #065F46;
	border: 1px solid #A7F3D0;
}

.zest-message--error {
	background-color: #FEE2E2;
	color: #991B1B;
	border: 1px solid #FECACA;
}

/* ==========================================================================
   Verify Result (Magic Link)
   ========================================================================== */

.zest-verify-result {
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 12px;
	padding: 48px 40px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.zest-verify-result__icon {
	margin-bottom: 20px;
}

.zest-verify-result__icon--success {
	color: #10B981;
}

.zest-verify-result__icon--error {
	color: #EF4444;
}

.zest-verify-result__title {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
	color: var(--zest-text-dark, #1F2937);
}

.zest-verify-result__message {
	margin: 0 0 24px;
	font-size: 15px;
	color: var(--zest-text-body, #4B5563);
}

.zest-verify-result__loading {
	display: flex;
	justify-content: center;
	margin-top: 16px;
}

/* ==========================================================================
   Account Wrapper Header
   ========================================================================== */

.zest-account__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 32px;
	padding-bottom: 24px;
	border-bottom: 1px solid #E5E7EB;
}

.zest-account__title {
	margin: 0 0 4px;
	font-size: 24px;
	font-weight: 700;
	color: var(--zest-text-dark, #1F2937);
}

.zest-account__email {
	margin: 0;
	font-size: 14px;
	color: var(--zest-text-body, #4B5563);
}

.zest-account__logout {
	font-size: 13px;
	color: var(--zest-text-body, #4B5563);
	text-decoration: none;
	white-space: nowrap;
}

.zest-account__logout:hover {
	color: var(--zest-primary, #7C3AED);
	text-decoration: underline;
}

/* ==========================================================================
   Refresh Notice
   ========================================================================== */

.zest-account__refresh-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
	padding: 12px 16px;
	background-color: #F3F4F6;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
}

.zest-account__refresh-text {
	margin: 0;
	font-size: 13px;
	color: var(--zest-text-body, #4B5563);
}

.zest-account__refresh-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--zest-primary, #7C3AED);
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.zest-account__refresh-btn:hover {
	border-color: var(--zest-primary, #7C3AED);
	box-shadow: 0 1px 2px rgba(124, 58, 237, 0.08);
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
}

.zest-account__refresh-btn svg {
	flex-shrink: 0;
}

/* ==========================================================================
   Account Footer
   ========================================================================== */

.zest-account__footer {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #E5E7EB;
	text-align: center;
}

.zest-account__link {
	font-size: 14px;
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
	font-weight: 500;
}

.zest-account__link:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.zest-account__empty {
	text-align: center;
	padding: 48px 24px;
}

.zest-account__empty-icon {
	color: #D1D5DB;
	margin-bottom: 16px;
}

.zest-account__empty h3 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

.zest-account__empty p {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--zest-text-body, #4B5563);
}

.zest-account__placeholder {
	background: var(--zest-bg-light, #F9FAFB);
	border: 1px solid #E5E7EB;
	border-radius: 8px;
	padding: 32px;
	text-align: center;
}

.zest-account__placeholder p {
	margin: 0;
	color: var(--zest-text-body, #4B5563);
}

/* ==========================================================================
   Purchases Sections
   ========================================================================== */

.zest-purchases__section {
	margin-bottom: 32px;
}

.zest-purchases__section:last-child {
	margin-bottom: 0;
}

.zest-purchases__heading {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ==========================================================================
   Status Badges
   ========================================================================== */

.zest-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 9999px;
	line-height: 1.6;
	white-space: nowrap;
}

.zest-badge--active {
	background-color: #D1FAE5;
	color: #065F46;
}

.zest-badge--warning {
	background-color: #FEF3C7;
	color: #92400E;
}

.zest-badge--expired {
	background-color: #FEE2E2;
	color: #991B1B;
}

.zest-badge--disabled {
	background-color: #F3F4F6;
	color: #6B7280;
}

.zest-badge--paid {
	background-color: #D1FAE5;
	color: #065F46;
}

.zest-badge--refunded {
	background-color: #FEE2E2;
	color: #991B1B;
}

.zest-badge--pending {
	background-color: #FEF3C7;
	color: #92400E;
}

/* ==========================================================================
   Orders List
   ========================================================================== */

.zest-orders {
	display: flex;
	flex-direction: column;
	gap: 1px;
	background: #E5E7EB;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	overflow: hidden;
}

.zest-order {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--zest-bg-white, #FFFFFF);
}

.zest-order__main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 1;
	min-width: 0;
	gap: 16px;
}

.zest-order__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.zest-order__number {
	font-size: 14px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

.zest-order__date {
	font-size: 13px;
	color: #9CA3AF;
}

.zest-order__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.zest-order__total {
	font-size: 14px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

.zest-order__actions {
	flex-shrink: 0;
	margin-left: 16px;
}

.zest-order__receipt-link {
	font-size: 13px;
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
}

.zest-order__receipt-link:hover {
	text-decoration: underline;
}

/* ==========================================================================
   License Cards
   ========================================================================== */

.zest-licenses {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.zest-license {
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.zest-license__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.zest-license__product {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

/* License Key Row */

.zest-license__key-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	padding: 10px 12px;
	background: var(--zest-bg-light, #F9FAFB);
	border: 1px solid #E5E7EB;
	border-radius: 6px;
}

.zest-license__key {
	flex: 1;
	font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;
	font-size: 13px;
	color: var(--zest-text-dark, #1F2937);
	word-break: break-all;
	padding: 0;
	background: transparent;
	border: none;
}

.zest-license__copy {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 500;
	color: var(--zest-primary, #7C3AED);
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
	line-height: 1;
}

.zest-license__copy:hover {
	background-color: var(--zest-primary-bg, #F5F3FF);
	border-color: var(--zest-primary, #7C3AED);
}

.zest-license__copy--copied {
	color: #059669;
	border-color: #A7F3D0;
	background-color: #D1FAE5;
}

.zest-license__copy--copied:hover {
	background-color: #D1FAE5;
	border-color: #A7F3D0;
}

/* License Details */

.zest-license__details {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

.zest-license__detail {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.zest-license__detail-label {
	font-size: 12px;
	font-weight: 500;
	color: #9CA3AF;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.zest-license__detail-value {
	font-size: 14px;
	font-weight: 500;
	color: var(--zest-text-dark, #1F2937);
}

/* Progress Bar */

.zest-license__progress {
	height: 4px;
	background: #E5E7EB;
	border-radius: 2px;
	overflow: hidden;
	margin-top: 4px;
}

.zest-license__progress-bar {
	height: 100%;
	background: var(--zest-primary, #7C3AED);
	border-radius: 2px;
	transition: width 0.3s ease;
}

/* License Actions */

.zest-license__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 12px;
	border-top: 1px solid #F3F4F6;
}

.zest-license__download {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #FFFFFF;
	background-color: var(--zest-primary, #7C3AED);
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, transform 0.1s ease;
	line-height: 1.5;
}

.zest-license__download:hover {
	background-color: var(--zest-primary-hover, #6D28D9);
}

.zest-license__download:active {
	transform: scale(0.97);
}

.zest-license__download:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.zest-license__download--loading {
	opacity: 0.7;
	cursor: wait;
}

.zest-license__manage-link {
	font-size: 13px;
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
	font-weight: 500;
}

.zest-license__manage-link:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
	.zest-account {
		margin: 24px auto;
		padding: 0 16px;
	}

	.zest-account--wide {
		max-width: 100%;
	}

	.zest-account__header {
		flex-direction: column;
		gap: 8px;
	}

	.zest-account__refresh-notice {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.zest-verify {
		padding: 24px 20px;
	}

	.zest-verify__title {
		font-size: 20px;
	}

	.zest-verify__description {
		font-size: 14px;
	}

	.zest-verify-result {
		padding: 32px 24px;
	}

	.zest-verify-result__title {
		font-size: 20px;
	}

	/* Orders responsive */
	.zest-order {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 14px 16px;
	}

	.zest-order__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		width: 100%;
	}

	.zest-order__meta {
		width: 100%;
		justify-content: space-between;
	}

	.zest-order__actions {
		margin-left: 0;
	}

	/* License cards responsive */
	.zest-license {
		padding: 16px;
	}

	.zest-license__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.zest-license__key-row {
		flex-direction: column;
		align-items: stretch;
	}

	.zest-license__copy {
		justify-content: center;
	}

	.zest-license__details {
		grid-template-columns: 1fr;
	}

	/* Register prompt responsive */
	.zest-register {
		padding: 24px 20px;
	}

	.zest-register__footer {
		flex-direction: column;
		gap: 8px;
	}

	.zest-register__separator {
		display: none;
	}
}

/* ==========================================================================
   Registration Prompt (Phase 8)
   ========================================================================== */

.zest-register {
	margin-top: 32px;
	background: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #E5E7EB;
	border-radius: 12px;
	padding: 32px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.zest-register__header {
	text-align: center;
	margin-bottom: 24px;
}

.zest-register__icon {
	color: var(--zest-primary, #7C3AED);
	margin-bottom: 12px;
}

.zest-register__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: var(--zest-text-dark, #1F2937);
}

.zest-register__description {
	margin: 0;
	font-size: 14px;
	color: var(--zest-text-body, #4B5563);
}

/* Benefits List */

.zest-register__benefits {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.zest-register__benefits li {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: var(--zest-text-dark, #1F2937);
}

.zest-register__benefits svg {
	color: #10B981;
	flex-shrink: 0;
}

/* Register Form */

.zest-register__form {
	margin-bottom: 20px;
}

.zest-register__messages:empty {
	display: none;
}

.zest-register__field {
	margin-bottom: 16px;
}

.zest-register__label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--zest-text-dark, #1F2937);
}

.zest-register__input {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--zest-text-dark, #1F2937);
	background-color: var(--zest-bg-white, #FFFFFF);
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.zest-register__input:focus {
	border-color: var(--zest-primary, #7C3AED);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.zest-register__input::placeholder {
	color: #9CA3AF;
}

.zest-register__input--disabled {
	background-color: var(--zest-bg-light, #F9FAFB);
	color: var(--zest-text-body, #4B5563);
	cursor: not-allowed;
}

.zest-register__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	color: #FFFFFF;
	background-color: var(--zest-primary, #7C3AED);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.2s ease, transform 0.1s ease;
	line-height: 1.5;
	box-sizing: border-box;
	position: relative;
}

.zest-register__submit:hover {
	background-color: var(--zest-primary-hover, #6D28D9);
}

.zest-register__submit:active {
	transform: scale(0.98);
}

.zest-register__submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.zest-register__submit--loading .zest-register__submit-text {
	visibility: hidden;
}

.zest-register__submit--loading .zest-verify__spinner {
	display: block;
}

/* Register Footer */

.zest-register__footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.zest-register__dismiss {
	font-size: 13px;
	color: #9CA3AF;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	text-decoration: none;
}

.zest-register__dismiss:hover {
	color: var(--zest-text-body, #4B5563);
	text-decoration: underline;
}

.zest-register__separator {
	color: #D1D5DB;
	font-size: 13px;
}

.zest-register__login-link {
	font-size: 13px;
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
}

.zest-register__login-link:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Login Prompt (Phase 8)
   ========================================================================== */

.zest-login-prompt {
	margin-top: 16px;
	text-align: center;
}

.zest-login-prompt p {
	margin: 0;
	font-size: 13px;
	color: var(--zest-text-body, #4B5563);
}

.zest-login-prompt a {
	color: var(--zest-primary, #7C3AED);
	text-decoration: none;
}

.zest-login-prompt a:hover {
	text-decoration: underline;
}
