/*
 * Copyright (C) 2026 Eli Gold
 *
 * This file is part of Resource Access Gate.
 *
 * Resource Access Gate is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * Resource Access Gate is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Resource Access Gate. If not, see <https://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

.rag-resource-gate {
	max-width: 540px;
	margin-top: 18px;
}

.rag-resource-gate--modal {
	max-width: none;
	margin: 0;
}

.rag-resource-modal[hidden] {
	display: none !important;
}

.rag-resource-modal {
	--rag-accent: #121066;
	--rag-accent-hover: #211ca0;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
	box-sizing: border-box;
	font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
}

.rag-resource-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 12, 28, .72);
	opacity: 0;
	transition: opacity .2s ease;
}

.rag-resource-modal.is-open .rag-resource-modal-backdrop {
	opacity: 1;
}

.rag-resource-dialog {
	position: relative;
	width: min(100%, 560px);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 42px 44px 40px;
	border-top: 4px solid var(--rag-accent);
	background: #fff;
	box-shadow: 0 28px 80px rgba(8, 9, 34, .32);
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(18px) scale(.985);
	transition: opacity .2s ease, transform .2s ease;
}

.rag-resource-modal.is-open .rag-resource-dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.rag-resource-dialog:focus {
	outline: none;
}

.rag-resource-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	display: grid;
	width: 38px;
	height: 38px;
	min-height: 0;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #56586d;
	font-size: 30px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	transition: color .16s ease, background .16s ease;
}

.rag-resource-modal-close:hover,
.rag-resource-modal-close:focus-visible {
	background: #f1f1f6;
	color: var(--rag-accent);
	outline: none;
}

.rag-resource-modal-kicker {
	margin: 0 0 8px;
	color: #77798b;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.rag-resource-dialog h2 {
	margin: 0;
	color: var(--rag-accent);
	font-size: clamp(28px, 4vw, 38px);
	line-height: 1.08;
}

.rag-resource-modal-title {
	margin: 12px 0 26px;
	color: #4f5165;
	font-size: 16px;
	line-height: 1.5;
}

body.rag-modal-is-open {
	overflow: hidden;
}

.rag-resource-form label {
	display: block;
	margin-bottom: 8px;
	color: #121066;
	font-weight: 500;
}

.rag-resource-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
}

.rag-resource-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.rag-resource-fields input[type="email"] {
	flex: 1 1 260px;
	min-height: 44px;
	margin: 0;
	padding: 0 13px;
	border: 1px solid #d9dce7;
	border-radius: 4px;
	background: #fff;
	color: #16172a;
	box-sizing: border-box;
}

.rag-resource-fields input[type="email"]:focus {
	border-color: #121066;
	outline: 2px solid rgba(18, 16, 102, .12);
}

.rag-resource-fields button,
.rag-resource-result a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 4px;
	background: #121066;
	color: #fff !important;
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
}

.rag-resource-fields button:hover,
.rag-resource-result a:hover {
	background: #211ca0;
	color: #fff !important;
}

.rag-resource-fields button:disabled {
	cursor: wait;
	opacity: .72;
}

.rag-resource-message {
	margin: 10px 0 0;
	color: #121066;
	font-size: 13px;
	line-height: 1.45;
}

.rag-resource-privacy {
	margin: 10px 0 0;
	color: #696b7d;
	font-size: 12px;
	line-height: 1.45;
}

.rag-resource-message.is-error {
	color: #b3261e;
	font-weight: 700;
}

.rag-resource-result {
	margin: 0;
}

.rag-resource-result-message {
	margin: 0 0 12px;
	color: #121066;
	font-size: 13px;
	line-height: 1.45;
}

.rag-resource-result-message.is-error {
	color: #7a4b00;
}

@media (max-width: 1000px) {
	.rag-resource-modal-close {
		width: 44px;
		height: 44px;
	}
}

@media (max-width: 640px) {
	.rag-resource-modal {
		inset: 0;
		height: 100dvh;
		align-items: end;
		padding: 12px;
		overflow: hidden;
		overscroll-behavior: contain;
	}

	.rag-resource-dialog {
		width: 100%;
		max-height: calc(100dvh - 24px);
		padding: 38px 22px 24px;
		overscroll-behavior: contain;
	}

	.rag-resource-fields {
		display: block;
	}

	.rag-resource-fields input[type="email"],
	.rag-resource-fields button,
	.rag-resource-result a {
		width: 100%;
		min-height: 48px;
	}

	.rag-resource-fields button {
		margin-top: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rag-resource-modal-backdrop,
	.rag-resource-dialog {
		transition: none;
	}
}

