/**
 * Gigantic Engine — global UI system (frontend + admin).
 *
 * @package GiganticEngine
 */

/* -------------------------------------------------------------------------
   Scope & box model
   ------------------------------------------------------------------------- */
.ge-form,
.ge-form *,
.ge-card {
	box-sizing: border-box;
}

.ge-hidden {
	display: none !important;
}

.ge-error-text {
	font-size: 12px;
	color: #e53935;
	margin-top: 4px;
}

.ge-form input.invalid,
.ge-form textarea.invalid,
.ge-form select.invalid {
	border-color: #e53935;
	box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.08);
	background: #fff;
}

.ge-form input.valid,
.ge-form textarea.valid,
.ge-form select.valid {
	border-color: #4caf50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.08);
	background: #fff;
}

.ge-form input:hover,
.ge-form textarea:hover,
.ge-form select:hover {
	border-color: #bbb;
}

.ge-success-flash {
	animation: geSuccessFlash 900ms ease-out 1;
}

@keyframes geSuccessFlash {
	0% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.0);
	}
	25% {
		box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.10);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.0);
	}
}

/* Wrap created around password inputs only (see ge-ui.js enhancePasswordToggles). */
.ge-password-field-wrap {
	position: relative;
	display: block;
	width: 100%;
}

.ge-password-toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(calc(-50% + 0.5px));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	border: 1px solid transparent;
	background: rgba(0, 0, 0, 0.02);
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ge-password-toggle:hover {
	background: rgba(0, 0, 0, 0.04);
	border-color: #e2e2e2;
}

.ge-password-toggle:focus-visible {
	outline: 0;
	border-color: #4caf50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

/* -------------------------------------------------------------------------
   Card shell
   ------------------------------------------------------------------------- */
.ge-card {
	background: #fff;
	padding: 24px;
	border-radius: 12px;
	border: 1px solid #eee;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ge-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
	.ge-card {
		padding: 15px;
	}
}

/* -------------------------------------------------------------------------
   Form layout
   ------------------------------------------------------------------------- */
.ge-form-group {
	margin-bottom: 18px;
}

.ge-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.ge-form label.screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ge-form .description,
.ge-form .ge-form-help {
	margin-top: 6px;
	font-size: 12px;
	color: #646970;
}

.ge-auth__field-meta {
	margin-top: 6px;
	margin-bottom: 0;
}

.ge-auth__field-meta a {
	font-weight: 600;
}

.ge-form {
	max-width: 500px;
	margin: 0 auto;
}

.wp-admin .ge-form {
	max-width: 700px;
}

.ge-input-group {
	display: flex;
	gap: 10px;
}

.ge-input-group > * {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 768px) {
	.ge-input-group {
		flex-direction: column;
	}
}

/* Inputs (not every control — avoid breaking WP chrome / payment radios) */
.ge-form input[type="text"],
.ge-form input[type="email"],
.ge-form input[type="url"],
.ge-form input[type="tel"],
.ge-form input[type="number"],
.ge-form input[type="password"],
.ge-form input[type="search"],
.ge-form textarea,
.ge-form select {
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
	background: #fafafa;
	color: #1d2327;
}

.ge-form input[type="password"] {
	padding-right: 46px;
}

.ge-form input:focus,
.ge-form textarea:focus,
.ge-form select:focus {
	background: #fff;
	border-color: #4caf50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
	outline: none;
}

.ge-form .is-error,
.ge-form input.is-error,
.ge-form textarea.is-error,
.ge-form select.is-error {
	border-color: #e53935;
}

.ge-form textarea {
	min-height: 120px;
	resize: vertical;
}

.ge-form select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23647470' d='M1.2 1.2 6 5.9 10.8 1.2 12 2.4l-6 5.4L0 2.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-color: #fff;
}

.ge-form input[type="file"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
	font-size: 14px;
	background: #fafafa;
}

/* Checkout summary coupon (outside main <form>, uses form="" attribute) */
.ge-checkout-summary input[type="text"],
.ge-checkout-summary input[type="email"],
.ge-checkout-summary input[type="number"],
.ge-checkout-summary textarea,
.ge-checkout-summary select {
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	background: #fafafa;
	color: #1d2327;
	box-sizing: border-box;
}

.ge-checkout-summary input:focus,
.ge-checkout-summary textarea:focus,
.ge-checkout-summary select:focus {
	background: #fff;
	border-color: #4caf50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
	outline: none;
}

.ge-checkout-summary label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	font-size: 13px;
}

/* Checkbox / radio rows */
.ge-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 8px;
}

.ge-check input[type="checkbox"],
.ge-check input[type="radio"] {
	width: 16px;
	height: 16px;
	min-width: 16px;
	margin-top: 2px;
	flex-shrink: 0;
}

.ge-check label {
	display: inline;
	margin-bottom: 0;
	font-weight: 400;
	font-size: 14px;
}

/* Payment method tiles (checkout): do not force full-width radios */
.ge-form .ge-payment-method input[type="radio"] {
	width: auto;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
}

.ge-form .ge-plan-card input[type="radio"],
.ge-form .ge-plan-card--selectable input[type="radio"] {
	width: auto;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
}

/* WordPress settings: form-table cells */
.ge-form .form-table th {
	padding-top: 12px;
	vertical-align: top;
	font-weight: 500;
	font-size: 13px;
}

.ge-form .form-table td .ge-form-group:last-child {
	margin-bottom: 0;
}

.ge-form .form-table input[type="text"],
.ge-form .form-table input[type="email"],
.ge-form .form-table input[type="url"],
.ge-form .form-table input[type="number"],
.ge-form .form-table input[type="password"],
.ge-form .form-table textarea,
.ge-form .form-table select {
	max-width: 32rem;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.ge-btn {
	display: inline-block;
	padding: 12px 18px;
	background: #4caf50;
	color: #fff !important;
	border-radius: 8px;
	border: none;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.3px;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ge-btn:hover {
	background: #43a047;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ge-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.22);
}

.ge-btn:active {
	transform: scale(0.98);
}

.ge-btn.loading {
	opacity: 0.7;
	pointer-events: none;
}

.ge-btn-block {
	width: 100%;
}

.ge-btn-secondary {
	background: #fff;
	color: #1d2327 !important;
	border: 1px solid #dcdcdc;
	box-shadow: none;
}

.ge-btn-secondary:hover {
	background: #f6f7f7;
	color: #1d2327 !important;
}

/* Keep secondary buttons subtle even with hover lift */
.ge-btn-secondary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Align WP primary buttons inside GE shells */
.ge-orders-shell .button.button-primary,
.ge-support-admin .button.button-primary,
.ge-admin-shell .button.button-primary {
	background: #4caf50;
	border-color: #43a047;
	color: #fff;
}

.ge-orders-shell .button.button-primary:hover,
.ge-support-admin .button.button-primary:hover,
.ge-admin-shell .button.button-primary:hover {
	background: #43a047;
	border-color: #388e3c;
	color: #fff;
}

/* -------------------------------------------------------------------------
   Alerts (standalone + legacy checkout notices)
   ------------------------------------------------------------------------- */
.ge-alert {
	padding: 12px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
	border-left: 4px solid;
}

.ge-alert-success,
.ge-checkout__notice--success {
	background: #e8f5e9;
	color: #2e7d32;
	border: 1px solid #c8e6c9;
	border-left-color: #4caf50;
}

.ge-alert-error,
.ge-checkout__notice--error {
	background: #ffebee;
	color: #c62828;
	border: 1px solid #ffcdd2;
	border-left-color: #e53935;
}

.ge-checkout__notice {
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 14px;
}

.ge-checkout__notice--info {
	background: #e3f2fd;
	color: #1565c0;
	border: 1px solid #bbdefb;
}

/* Payment proof image (replaces inline style) */
.ge-payment-proof-thumb {
	max-width: 100%;
	height: auto;
	border: 1px solid #d0d7de;
	border-radius: 8px;
}

/* Commerce: honeypot + form timestamp (visually hidden). */
.ge-spam-fields {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ge-spam-fields__hp {
	display: block;
}
