/* ==========================================================================
   AMIGO Contribution — Frontend Styles
   Luxury dark theme: #08111D bg, #101827 popup, #C8A35A gold
   ========================================================================== */

/* ── Custom Properties ─────────────────────────────────────────────────── */
:root {
	--amigo-bg:            #08111D;
	--amigo-popup:         #101827;
	--amigo-popup-border:  rgba(200, 163, 90, 0.18);
	--amigo-gold:          #C8A35A;
	--amigo-gold-light:    #DDB96A;
	--amigo-gold-dark:     #A8832A;
	--amigo-text:          #F0EDE8;
	--amigo-text-muted:    rgba(240, 237, 232, 0.55);
	--amigo-input-bg:      rgba(255, 255, 255, 0.05);
	--amigo-input-border:  rgba(200, 163, 90, 0.25);
	--amigo-input-focus:   rgba(200, 163, 90, 0.6);
	--amigo-error:         #E05A5A;
	--amigo-success:       #5ABF8A;
	--amigo-radius:        16px;
	--amigo-radius-sm:     10px;
	--amigo-radius-btn:    8px;
	--amigo-shadow:        0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(200,163,90,0.1);
	--amigo-font-serif:    'Cormorant Garamond', Georgia, serif;
	--amigo-font-sans:     'Outfit', system-ui, sans-serif;
	--amigo-transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Overlay ───────────────────────────────────────────────────────────── */
.amigo-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(8, 17, 29, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--amigo-transition), visibility var(--amigo-transition);
}

.amigo-overlay.amigo-is-open {
	opacity: 1;
	visibility: visible;
}

/* ── Popup Container ───────────────────────────────────────────────────── */
.amigo-popup {
	position: relative;
	background: var(--amigo-popup);
	border: 1px solid var(--amigo-popup-border);
	border-radius: var(--amigo-radius);
	box-shadow: var(--amigo-shadow);
	padding: 48px 44px;
	width: 100%;
	max-width: 460px;
	font-family: var(--amigo-font-sans);
	color: var(--amigo-text);
	transform: translateY(20px) scale(0.97);
	transition: transform var(--amigo-transition);
	max-height: 92vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--amigo-gold-dark) transparent;
}

.amigo-overlay.amigo-is-open .amigo-popup {
	transform: translateY(0) scale(1);
}

.amigo-popup::-webkit-scrollbar {
	width: 4px;
}
.amigo-popup::-webkit-scrollbar-track {
	background: transparent;
}
.amigo-popup::-webkit-scrollbar-thumb {
	background: var(--amigo-gold-dark);
	border-radius: 4px;
}

/* ── Close Button ──────────────────────────────────────────────────────── */
.amigo-popup__close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(200, 163, 90, 0.08);
	border: 1px solid rgba(200, 163, 90, 0.2);
	border-radius: 50%;
	cursor: pointer;
	transition: background var(--amigo-transition), border-color var(--amigo-transition);
}

.amigo-popup__close:hover {
	background: rgba(200, 163, 90, 0.18);
	border-color: rgba(200, 163, 90, 0.5);
}

/* ── Header ────────────────────────────────────────────────────────────── */
.amigo-popup__header {
	text-align: center;
	margin-bottom: 32px;
}

.amigo-popup__ornament {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.amigo-popup__ornament--flip {
	margin-bottom: 0;
	margin-top: 16px;
}

.amigo-popup__title {
	font-family: var(--amigo-font-serif);
	font-size: 2rem;
	font-weight: 600;
	color: var(--amigo-text);
	margin: 0 0 8px;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.amigo-popup__title--sm {
	font-size: 1.6rem;
}

.amigo-popup__subtitle {
	font-family: var(--amigo-font-sans);
	font-size: 0.875rem;
	font-weight: 300;
	color: var(--amigo-text-muted);
	margin: 0;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ── Logo (MECENAS) ────────────────────────────────────────────────────── */
.amigo-popup__logo {
	text-align: center;
	margin-bottom: 28px;
}

.amigo-popup__logo img {
	max-height: 60px;
	width: auto;
	object-fit: contain;
}

/* ── Field Group ───────────────────────────────────────────────────────── */
.amigo-field-group {
	margin-bottom: 20px;
}

.amigo-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--amigo-gold);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-bottom: 8px;
}

.amigo-currency-symbol {
	color: var(--amigo-text-muted);
	font-weight: 300;
}

/* ── Inputs ────────────────────────────────────────────────────────────── */
.amigo-input {
	width: 100%;
	background: var(--amigo-input-bg);
	border: 1px solid var(--amigo-input-border);
	border-radius: var(--amigo-radius-sm);
	padding: 14px 16px;
	font-family: var(--amigo-font-sans);
	font-size: 1rem;
	font-weight: 400;
	color: var(--amigo-text);
	outline: none;
	transition: border-color var(--amigo-transition), box-shadow var(--amigo-transition), background var(--amigo-transition);
	-webkit-appearance: none;
	box-sizing: border-box;
}

.amigo-input:focus {
	border-color: var(--amigo-gold);
	box-shadow: 0 0 0 3px var(--amigo-input-focus);
	background: rgba(255, 255, 255, 0.07);
}

.amigo-input::placeholder {
	color: var(--amigo-text-muted);
}

/* Remove number input arrows */
.amigo-input[type="number"]::-webkit-inner-spin-button,
.amigo-input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.amigo-input[type="number"] { -moz-appearance: textfield; }

/* Amount wrap with prefix */
.amigo-amount-wrap {
	position: relative;
}

.amigo-amount-prefix {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--amigo-gold);
	font-size: 1rem;
	font-weight: 500;
	pointer-events: none;
	z-index: 1;
}

.amigo-amount-input {
	padding-left: 32px;
}

.amigo-field-hint {
	font-size: 0.75rem;
	color: var(--amigo-text-muted);
	margin: 6px 0 0;
}

/* Password wrap */
.amigo-password-wrap {
	position: relative;
}

.amigo-password-wrap .amigo-input {
	padding-right: 48px;
}

.amigo-password-toggle {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--amigo-text-muted);
	padding: 4px;
	display: flex;
	align-items: center;
	transition: color var(--amigo-transition);
}

.amigo-password-toggle:hover {
	color: var(--amigo-gold);
}

/* ── Preset Amount Buttons ─────────────────────────────────────────────── */
.amigo-presets {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin-bottom: 24px;
}

.amigo-preset-btn {
	background: var(--amigo-input-bg);
	border: 1px solid var(--amigo-input-border);
	border-radius: var(--amigo-radius-btn);
	padding: 10px 8px;
	font-family: var(--amigo-font-sans);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--amigo-text-muted);
	cursor: pointer;
	transition: all var(--amigo-transition);
	text-align: center;
}

.amigo-preset-btn:hover,
.amigo-preset-btn.amigo-preset-active {
	background: rgba(200, 163, 90, 0.12);
	border-color: var(--amigo-gold);
	color: var(--amigo-gold);
}

/* ── Mode Toggle Buttons ───────────────────────────────────────────────── */
.amigo-mode-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 24px;
}

.amigo-mode-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 16px;
	background: var(--amigo-input-bg);
	border: 1px solid var(--amigo-input-border);
	border-radius: var(--amigo-radius-sm);
	font-family: var(--amigo-font-sans);
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--amigo-text-muted);
	cursor: pointer;
	transition: all var(--amigo-transition);
	position: relative;
	overflow: hidden;
}

/* Explicit inactive state — never hidden */
.amigo-mode-btn:not(.amigo-mode-btn--active) {
	opacity: 1;
	display: flex !important;
	visibility: visible !important;
}

.amigo-mode-btn:hover {
	border-color: rgba(200, 163, 90, 0.4);
	color: var(--amigo-text);
}

.amigo-mode-btn--active {
	background: rgba(200, 163, 90, 0.1);
	border-color: var(--amigo-gold);
	color: var(--amigo-gold);
	box-shadow: 0 0 16px rgba(200, 163, 90, 0.15);
}

.amigo-mode-btn--active::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(200, 163, 90, 0.08) 0%, transparent 60%);
	pointer-events: none;
}

.amigo-mode-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

/* Hide mode group entirely if only one mode available */
.amigo-mode-group.amigo-mode-group--single {
	display: none;
}

/* ── Error / Success Messages ──────────────────────────────────────────── */
.amigo-error-message {
	font-size: 0.825rem;
	color: var(--amigo-error);
	padding: 10px 14px;
	background: rgba(224, 90, 90, 0.08);
	border: 1px solid rgba(224, 90, 90, 0.2);
	border-radius: var(--amigo-radius-btn);
	margin-bottom: 16px;
	display: none;
	line-height: 1.5;
}

.amigo-error-message.amigo-is-visible {
	display: block;
	animation: amigo-shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes amigo-shake {
	0%, 100% { transform: translateX(0); }
	20%       { transform: translateX(-6px); }
	40%       { transform: translateX(6px); }
	60%       { transform: translateX(-4px); }
	80%       { transform: translateX(4px); }
}

/* ── Primary Button ────────────────────────────────────────────────────── */
.amigo-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 15px 28px;
	border-radius: var(--amigo-radius-btn);
	font-family: var(--amigo-font-sans);
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	border: none;
	transition: all var(--amigo-transition);
	text-decoration: none;
	min-width: 140px;
}

.amigo-btn--primary {
	background: linear-gradient(135deg, var(--amigo-gold) 0%, var(--amigo-gold-dark) 100%);
	color: #0A0A0A;
	box-shadow: 0 4px 24px rgba(200, 163, 90, 0.3);
}

.amigo-btn--primary:hover {
	background: linear-gradient(135deg, var(--amigo-gold-light) 0%, var(--amigo-gold) 100%);
	box-shadow: 0 6px 32px rgba(200, 163, 90, 0.45);
	transform: translateY(-1px);
}

.amigo-btn--primary:active {
	transform: translateY(0);
	box-shadow: 0 2px 12px rgba(200, 163, 90, 0.3);
}

.amigo-btn--primary:disabled,
.amigo-btn--primary.amigo-is-loading {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.amigo-btn--ghost {
	background: transparent;
	border: 1px solid rgba(240, 237, 232, 0.2);
	color: var(--amigo-text-muted);
}

.amigo-btn--ghost:hover {
	border-color: rgba(240, 237, 232, 0.4);
	color: var(--amigo-text);
}

.amigo-btn--full {
	width: 100%;
}

/* Spinner inside button */
.amigo-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(10, 10, 10, 0.3);
	border-top-color: #0A0A0A;
	border-radius: 50%;
	animation: amigo-spin 0.7s linear infinite;
	flex-shrink: 0;
}

.amigo-is-loading .amigo-btn-spinner {
	display: block;
}

.amigo-is-loading .amigo-btn-text {
	opacity: 0.6;
}

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

/* ── Popup Actions ─────────────────────────────────────────────────────── */
.amigo-popup__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
}

/* ── Links ─────────────────────────────────────────────────────────────── */
.amigo-popup__links {
	text-align: center;
	margin-top: 20px;
	font-size: 0.825rem;
}

.amigo-link {
	color: var(--amigo-gold);
	text-decoration: none;
	font-weight: 500;
	transition: color var(--amigo-transition);
}

.amigo-link:hover {
	color: var(--amigo-gold-light);
}

.amigo-link-sep {
	color: var(--amigo-text-muted);
	margin: 0 8px;
}

/* ── Panel transitions (MECENAS login ↔ register) ─────────────────────── */
.amigo-panel {
	transition: opacity var(--amigo-transition), transform var(--amigo-transition);
}

.amigo-panel--hidden {
	display: none;
}

/* ── Elementor Widget Button ───────────────────────────────────────────── */
.amigo-widget-wrap {
	line-height: 1;
}

.amigo-widget-btn {
	font-family: var(--amigo-font-sans);
	cursor: pointer;
	transition: all var(--amigo-transition);
}

/* Styles */
.amigo-style-gold {
	background: linear-gradient(135deg, var(--amigo-gold) 0%, var(--amigo-gold-dark) 100%);
	color: #0A0A0A;
	border: none;
	border-radius: var(--amigo-radius-btn);
	padding: 14px 28px;
	font-weight: 500;
	letter-spacing: 0.04em;
	box-shadow: 0 4px 20px rgba(200, 163, 90, 0.25);
}

.amigo-style-gold:hover {
	background: linear-gradient(135deg, var(--amigo-gold-light) 0%, var(--amigo-gold) 100%);
	box-shadow: 0 6px 28px rgba(200, 163, 90, 0.4);
	transform: translateY(-1px);
}

.amigo-style-outline {
	background: transparent;
	color: var(--amigo-gold);
	border: 2px solid var(--amigo-gold);
	border-radius: var(--amigo-radius-btn);
	padding: 12px 26px;
	font-weight: 500;
}

.amigo-style-outline:hover {
	background: rgba(200, 163, 90, 0.1);
}

.amigo-style-ghost {
	background: transparent;
	color: var(--amigo-text);
	border: 1px solid rgba(240, 237, 232, 0.3);
	border-radius: var(--amigo-radius-btn);
	padding: 13px 26px;
	font-weight: 400;
}

.amigo-style-ghost:hover {
	border-color: var(--amigo-gold);
	color: var(--amigo-gold);
}

/* Sizes */
.amigo-size-sm { font-size: 0.8rem;  padding: 10px 20px; }
.amigo-size-md { font-size: 0.9rem;  padding: 13px 26px; }
.amigo-size-lg { font-size: 1rem;    padding: 16px 32px; }
.amigo-size-xl { font-size: 1.1rem;  padding: 20px 40px; }

.amigo-full-width { width: 100%; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
	.amigo-popup {
		padding: 36px 24px;
	}

	.amigo-popup__title {
		font-size: 1.6rem;
	}

	.amigo-presets {
		grid-template-columns: repeat(2, 1fr);
	}

	.amigo-mode-group {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 360px) {
	.amigo-popup {
		padding: 28px 18px;
	}

	.amigo-mode-group {
		grid-template-columns: 1fr;
	}
}

/* ── Accessibility: reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.amigo-overlay,
	.amigo-popup,
	.amigo-btn,
	.amigo-mode-btn,
	.amigo-preset-btn,
	.amigo-input {
		transition: none;
	}
	@keyframes amigo-shake { to {} }
	@keyframes amigo-spin  { to {} }
}
