:root {
	--rap-bg: #fafafa;
	--rap-text: #1a1a1a;
	--rap-muted: #777;
	--rap-accent: #1a1a1a;
	--rap-error: #b3261e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--rap-bg);
	color: var(--rap-text);
	-webkit-font-smoothing: antialiased;
}

.rap-brand {
	text-transform: uppercase;
	letter-spacing: 0.24em;
	font-size: 15px;
	font-weight: 600;
	color: var(--rap-text);
}

.rap-brand a {
	color: inherit;
	text-decoration: none;
}

.rap-brand a:hover { color: var(--rap-muted); }

.rap-footer {
	display: flex;
	justify-content: center;
	gap: 4px;
	padding: 26px 0 90px;
}

.rap-login-card .rap-footer { padding: 22px 0 0; }

.rap-footer a {
	width: 37px;
	height: 37px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s;
}

.rap-footer a:hover { opacity: 0.85; }

.rap-contact-line {
	margin-top: 18px;
	text-align: center;
	font-size: 13px;
}

.rap-contact-line a, .rap-meta .rap-contact-link {
	color: var(--rap-muted);
	text-decoration: underline;
}

.rap-contact-line a:hover, .rap-meta .rap-contact-link:hover { color: var(--rap-text); }

/* ---- Login ---- */

.rap-login-wrap {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.rap-login-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 40px 36px;
	width: 100%;
	max-width: 420px;
}

.rap-login-card h1 {
	font-size: 24px;
	font-weight: 600;
	margin: 10px 0 6px;
}

.rap-login-card .rap-sub {
	color: var(--rap-muted);
	font-size: 14px;
	margin-bottom: 22px;
}

.rap-login-card label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin: 14px 0 4px;
}

.rap-login-card input[type="email"],
.rap-login-card input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	border: 1px solid #ccc;
	border-radius: 5px;
	background: #fff;
}

.rap-login-card input:focus {
	outline: 2px solid var(--rap-accent);
	outline-offset: 1px;
}

.rap-optin {
	display: flex !important;
	gap: 8px;
	align-items: flex-start;
	font-weight: 400 !important;
	font-size: 13px !important;
	color: var(--rap-muted);
	margin-top: 18px !important;
	line-height: 1.4;
}

.rap-optin input { margin-top: 2px; }

.rap-login-card button {
	width: 100%;
	margin-top: 20px;
	padding: 12px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--rap-accent);
	border: none;
	border-radius: 5px;
	cursor: pointer;
}

.rap-login-card button:hover { opacity: 0.88; }

.rap-error {
	background: #fdecea;
	color: var(--rap-error);
	font-size: 13px;
	padding: 10px 12px;
	border-radius: 5px;
	margin-bottom: 6px;
}

/* ---- Gallery ---- */

.rap-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 28px 24px 18px;
	max-width: 1500px;
	margin: 0 auto;
}

.rap-header h1 {
	font-size: 26px;
	font-weight: 600;
	margin: 6px 0 4px;
}

.rap-meta {
	font-size: 13px;
	color: var(--rap-muted);
}

.rap-meta a { color: var(--rap-muted); }

.rap-btn {
	display: inline-block;
	padding: 10px 18px;
	background: var(--rap-accent);
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	border-radius: 5px;
	white-space: nowrap;
}

.rap-btn:hover { opacity: 0.88; }

.rap-note {
	max-width: 1500px;
	margin: 0 auto 14px;
	padding: 10px 24px 0;
	font-size: 13px;
	color: var(--rap-muted);
}

.rap-done-q { color: #bbb; }

.rap-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
	padding: 0 24px;
	max-width: 1500px;
	margin: 0 auto;
}

.rap-item {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 4px;
	background: #eee;
	cursor: pointer;
}

.rap-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.rap-item:hover img { transform: scale(1.025); }

.rap-item figcaption {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	padding: 18px 10px 8px;
	font-size: 11px;
	color: #fff;
	background: linear-gradient(transparent, rgba(0,0,0,0.55));
	opacity: 0;
	transition: opacity 0.2s;
	pointer-events: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rap-item:hover figcaption { opacity: 1; }

.rap-fav, .rap-dl {
	position: absolute;
	top: 8px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	cursor: pointer;
	background: rgba(255,255,255,0.92);
	color: #999;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}

.rap-fav { right: 8px; }
.rap-dl  { right: 48px; }

.rap-fav:hover { color: #c22; }
.rap-dl:hover  { color: #000; }

.rap-fav.is-on { color: #c22; background: #fff; }

@media (hover: hover) {
	.rap-item .rap-dl { opacity: 0; }
	.rap-item:hover .rap-dl { opacity: 1; }
}

/* ---- Selection bar ---- */

.rap-selectbar {
	position: fixed;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 14px;
	background: #1a1a1a;
	color: #fff;
	padding: 10px 12px 10px 20px;
	border-radius: 999px;
	box-shadow: 0 6px 24px rgba(0,0,0,0.25);
	font-size: 14px;
	z-index: 40;
}

.rap-selectbar button {
	background: #fff;
	color: #1a1a1a;
	border: none;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.rap-selectbar button:disabled { opacity: 0.6; cursor: default; }

.rap-selectbar .rap-bar-ghost {
	background: transparent;
	color: #bbb;
	border: 1px solid #555;
}

.rap-selectbar .rap-bar-ghost:hover { color: #fff; border-color: #999; }

/* ---- Lightbox ---- */

.rap-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10,10,10,0.96);
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rap-lightbox[hidden] { display: none; }

.rap-lightbox img#rap-lb-img {
	max-width: 92vw;
	max-height: 84vh;
	object-fit: contain;
	border-radius: 2px;
}

.rap-lb-close, .rap-lb-prev, .rap-lb-next {
	position: absolute;
	background: none;
	border: none;
	color: #ddd;
	cursor: pointer;
	z-index: 51;
	line-height: 1;
}

.rap-lb-close { top: 14px; right: 20px; font-size: 34px; }
.rap-lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); font-size: 52px; padding: 20px 14px; }
.rap-lb-next  { right: 10px; top: 50%; transform: translateY(-50%); font-size: 52px; padding: 20px 14px; }

.rap-lb-close:hover, .rap-lb-prev:hover, .rap-lb-next:hover { color: #fff; }

.rap-lb-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 14px;
	color: #bbb;
	font-size: 13px;
}

.rap-lb-bar button, .rap-lb-bar a {
	background: none;
	border: none;
	color: #bbb;
	font-size: 18px;
	cursor: pointer;
	text-decoration: none;
}

.rap-lb-bar button:hover, .rap-lb-bar a:hover { color: #fff; }

#rap-lb-fav[aria-pressed="true"] { color: #e35b5b; }

/* ---- Share modal ---- */

.rap-modal {
	position: fixed;
	inset: 0;
	background: rgba(10,10,10,0.55);
	z-index: 55;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.rap-modal[hidden] { display: none; }

.rap-modal-card {
	background: #fff;
	border-radius: 8px;
	padding: 28px;
	width: 100%;
	max-width: 400px;
	box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.rap-modal-card h2 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }

.rap-modal-card p { font-size: 14px; color: var(--rap-muted); margin-bottom: 16px; }

.rap-modal-card label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
}

.rap-modal-card label span { font-weight: 400; color: var(--rap-muted); }

.rap-modal-card input {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 5px;
}

.rap-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

.rap-modal-actions button {
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 5px;
	border: none;
	cursor: pointer;
}

#rap-share-send { background: var(--rap-accent); color: #fff; }

#rap-share-send:disabled { opacity: 0.6; cursor: default; }

.rap-btn-ghost { background: #eee; color: var(--rap-text); }

/* ---- Toast ---- */

.rap-toast {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #1a1a1a;
	color: #fff;
	padding: 12px 22px;
	border-radius: 6px;
	font-size: 14px;
	z-index: 60;
	box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

@media (max-width: 600px) {
	.rap-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 0 10px 90px; }
	.rap-header { padding: 20px 14px 12px; }
	.rap-header h1 { font-size: 21px; }
	.rap-item .rap-dl { opacity: 1; }
}
