/**
 * EU Withdrawal Button — Frontend Styles
 *
 * @package EU_Withdrawal_Button
 */

/* ==========================================================================
   Sticky Bar
   ========================================================================== */

.ewb-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #f8f9fa;
	border-top: 1px solid #dee2e6;
	padding: 10px 0;
	transition: transform 0.3s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ewb-sticky-bar--bottom {
	bottom: 0;
	border-top: 1px solid #dee2e6;
	border-bottom: none;
	animation: ewb-slide-up 0.4s ease;
}

.ewb-sticky-bar--top {
	top: 0;
	border-bottom: 1px solid #dee2e6;
	border-top: none;
	animation: ewb-slide-down 0.4s ease;
}

.ewb-sticky-bar--hidden {
	transform: translateY(100%);
}

.ewb-sticky-bar--top.ewb-sticky-bar--hidden {
	transform: translateY(-100%);
}

.ewb-sticky-bar__text {
	font-size: 14px;
	color: #495057;
	line-height: 1.4;
}

.ewb-sticky-bar__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.ewb-sticky-bar__close {
	background: none;
	border: none;
	font-size: 20px;
	color: #6c757d;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	border-radius: 3px;
	transition: color 0.2s;
}

.ewb-sticky-bar__close:hover,
.ewb-sticky-bar__close:focus {
	color: #343a40;
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

@keyframes ewb-slide-up {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

@keyframes ewb-slide-down {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}

/* ==========================================================================
   Trigger Button
   ========================================================================== */

.ewb-withdrawal-trigger {
	display: inline-block;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: opacity 0.2s, box-shadow 0.2s;
	white-space: nowrap;
}

.ewb-withdrawal-trigger:hover {
	opacity: 0.9;
}

.ewb-withdrawal-trigger:focus {
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.ewb-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	overflow-y: auto;
}

.ewb-modal[aria-hidden="false"] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ewb-modal__overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	animation: ewb-fade-in 0.2s ease;
}

.ewb-modal__container {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 32px;
	z-index: 1;
	animation: ewb-scale-in 0.25s ease;
}

.ewb-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 24px;
	color: #6c757d;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	border-radius: 3px;
	transition: color 0.2s;
}

.ewb-modal__close:hover,
.ewb-modal__close:focus {
	color: #343a40;
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

@keyframes ewb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes ewb-scale-in {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

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

.ewb-form-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #212529;
	line-height: 1.5;
}

.ewb-form__title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 700;
	color: #212529;
}

.ewb-form__description {
	margin: 0 0 24px;
	font-size: 14px;
	color: #6c757d;
}

.ewb-field {
	margin-bottom: 16px;
}

.ewb-field__label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #212529;
}

.ewb-field__label .required {
	color: #dc3545;
}

.ewb-field__optional {
	font-weight: 400;
	color: #6c757d;
}

.ewb-field__input {
	display: block;
	width: 100%;
	padding: 8px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: #212529;
	background: #fff;
	border: 1px solid #ced4da;
	border-radius: 4px;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.ewb-field__input:focus {
	border-color: #0d6efd;
	outline: 0;
	box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.ewb-field__input--error {
	border-color: #dc3545;
}

.ewb-field__input--error:focus {
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.ewb-field__error {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: #dc3545;
	min-height: 0;
}

select.ewb-field__input {
	appearance: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ewb-btn {
	display: inline-block;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
}

.ewb-btn:focus {
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

.ewb-btn--primary {
	background-color: #0d6efd;
	color: #fff;
	border-color: #0d6efd;
}

.ewb-btn--primary:hover {
	background-color: #0b5ed7;
	border-color: #0a58ca;
}

.ewb-btn--secondary {
	background-color: #6c757d;
	color: #fff;
	border-color: #6c757d;
}

.ewb-btn--secondary:hover {
	background-color: #5c636a;
	border-color: #565e64;
}

.ewb-btn--confirm {
	background-color: #dc3545;
	border-color: #dc3545;
}

.ewb-btn--confirm:hover {
	background-color: #bb2d3b;
	border-color: #b02a37;
}

.ewb-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.ewb-form__actions {
	margin-top: 24px;
	display: flex;
	gap: 12px;
}

/* ==========================================================================
   Messages & Loading
   ========================================================================== */

.ewb-form__message--error {
	margin-top: 16px;
	padding: 12px 16px;
	background: #f8d7da;
	color: #842029;
	border: 1px solid #f5c2c7;
	border-radius: 4px;
	font-size: 14px;
}

.ewb-form__loading {
	margin-top: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #6c757d;
}

.ewb-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #dee2e6;
	border-top-color: #0d6efd;
	border-radius: 50%;
	animation: ewb-spin 0.6s linear infinite;
}

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

/* ==========================================================================
   Order Summary (Confirmation Step)
   ========================================================================== */

.ewb-confirmation__title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
}

.ewb-order-summary {
	margin-bottom: 24px;
	padding: 16px;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
}

.ewb-order-summary__row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 14px;
}

.ewb-order-summary__row--header {
	font-weight: 600;
	border-bottom: 1px solid #dee2e6;
	padding-bottom: 8px;
	margin-bottom: 8px;
}

.ewb-order-summary__row--total {
	font-weight: 700;
	border-top: 1px solid #dee2e6;
	padding-top: 8px;
	margin-top: 8px;
}

.ewb-confirmation__actions {
	display: flex;
	gap: 12px;
}

/* ==========================================================================
   Success State
   ========================================================================== */

.ewb-success {
	text-align: center;
	padding: 16px 0;
}

.ewb-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: #d1e7dd;
	color: #0f5132;
	border-radius: 50%;
	font-size: 28px;
	margin-bottom: 16px;
}

.ewb-success__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: #0f5132;
}

.ewb-success__message {
	margin: 0 0 24px;
	font-size: 14px;
	color: #6c757d;
}

/* ==========================================================================
   Order View — Withdrawal Box
   ========================================================================== */

.ewb-order-box {
	padding: 24px;
	margin: 24px 0;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
}

.ewb-order-box--withdrawn {
	background: #fff3cd;
	border-color: #ffc107;
}

.ewb-order-box--completed {
	background: #d1e7dd;
	border-color: #198754;
}

.ewb-order-box--rejected {
	background: #f8d7da;
	border-color: #dc3545;
}

.ewb-order-box__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
}

.ewb-order-box p {
	margin: 0 0 8px;
	font-size: 14px;
	line-height: 1.6;
}

.ewb-order-box__btn {
	margin-top: 12px;
	display: inline-block;
	padding: 12px 24px !important;
	background: #212529 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 4px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	cursor: pointer;
	transition: background 0.15s;
}

.ewb-order-box__btn:hover {
	background: #343a40 !important;
}

/* ==========================================================================
   My Account — Status Labels
   ========================================================================== */

.ewb-my-account-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	background: #fff3cd;
	color: #664d03;
}

.ewb-my-account-completed {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	background: #d1e7dd;
	color: #0f5132;
}

.ewb-my-account-rejected {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	background: #f8d7da;
	color: #842029;
}

.ewb-my-account-expired {
	color: #6c757d;
	font-size: 13px;
}

/* ==========================================================================
   Thank You Page Info Box
   ========================================================================== */

.ewb-thankyou-box {
	display: flex;
	gap: 16px;
	padding: 20px;
	margin: 20px 0;
	background: #e8f4fd;
	border: 1px solid #bee5eb;
	border-radius: 6px;
	align-items: flex-start;
}

.ewb-thankyou-box__icon {
	font-size: 24px;
	color: #0d6efd;
	flex-shrink: 0;
	line-height: 1;
}

.ewb-thankyou-box__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	color: #212529;
}

.ewb-thankyou-box__text {
	margin: 0 0 12px;
	font-size: 14px;
	color: #495057;
}

/* ==========================================================================
   Countdown Badge (My Account)
   ========================================================================== */

.ewb-countdown {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	vertical-align: middle;
	margin-left: 6px;
}

.ewb-countdown--green {
	background: #d1e7dd;
	color: #0f5132;
}

.ewb-countdown--yellow {
	background: #fff3cd;
	color: #664d03;
}

.ewb-countdown--red {
	background: #f8d7da;
	color: #842029;
}

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

@media (max-width: 600px) {
	.ewb-sticky-bar__inner {
		flex-direction: column;
		text-align: center;
		padding: 8px 20px;
		gap: 8px;
	}

	.ewb-sticky-bar__text {
		font-size: 13px;
	}

	.ewb-sticky-bar__close {
		position: absolute;
		top: 4px;
		right: 8px;
	}

	.ewb-modal__container {
		width: 95%;
		padding: 24px 20px;
		margin: 20px auto;
	}

	.ewb-form__actions,
	.ewb-confirmation__actions {
		flex-direction: column;
	}

	.ewb-btn {
		width: 100%;
	}

	.ewb-order-summary__row {
		flex-direction: column;
		gap: 2px;
	}
}

/* ==========================================================================
   Accessibility — reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.ewb-sticky-bar,
	.ewb-modal__overlay,
	.ewb-modal__container,
	.ewb-spinner {
		animation: none;
		transition: none;
	}
}
