/* ============================================================================
   1RR — Save Modal styles
   ============================================================================
   Append to houzez-child/style.css OR include as standalone via mu-plugin
   wp_register_style. Selectors all prefixed `.rr-save-*` so they don't
   collide with Houzez or any other plugin's styles.

   Companion files (see /wp-content/mu-plugins/1rr-save-modal.php for the full
   architecture diagram):
     - 1rr-save-modal.php          (modal markup at wp_footer)
     - 1rr-magic-link.php          (passwordless auth backend)
     - save-modal.js               (heart-click interception + modal logic)

   Color palette:
     --rr-charcoal #1a1a1a   primary text
     --rr-mid      #5b6f84   secondary text
     --rr-line     #e5e7eb   borders
     --rr-bg-soft  #f7f8fa   subtle backgrounds
     --rr-cheese   #FFC72C   focus/accent (the WI nod, used sparingly)
     --rr-red      #f54343   destructive/error
   These are inlined here in case the parent theme doesn't define them.
   ========================================================================== */

/* ===== overlay + modal frame ============================================== */
.rr-save-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9000;
	padding: 16px;
}
.rr-save-overlay.is-open { display: flex; }

.rr-save-modal {
	background: #fff;
	width: 100%;
	max-width: 460px;
	border-radius: 12px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1a1a1a;
	animation: rrSaveSlide 0.18s ease;
}
@keyframes rrSaveSlide {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ===== header ============================================================= */
.rr-save-head {
	padding: 18px 22px 14px;
	border-bottom: 1px solid #e5e7eb;
	display: flex;
	align-items: flex-end;
	gap: 12px;
}
.rr-save-head h2 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 500;
	font-size: 22px;
	line-height: 1.1;
	margin: 0;
	flex: 1;
	color: #1a1a1a;
}
.rr-save-close {
	background: none;
	border: 0;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #5b6f84;
	padding: 4px 8px;
}
.rr-save-close:hover { color: #1a1a1a; }

/* ===== body / sections ==================================================== */
.rr-save-body { padding: 20px 22px 24px; }
.rr-save-section { margin-bottom: 16px; }
.rr-save-section:last-child { margin-bottom: 0; }

.rr-save-pitch {
	font-size: 14px;
	line-height: 1.5;
	color: #5b6f84;
	margin: 0 0 14px;
}
.rr-save-pitch strong { color: #1a1a1a; }

/* ===== email input + primary submit ====================================== */
.rr-save-email-row {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}
.rr-save-email-row input[type="email"] {
	flex: 1;
	padding: 10px 12px;
	font-size: 15px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-family: inherit;
	color: #1a1a1a;
	background: #fff;
}
.rr-save-email-row input[type="email"]:focus {
	outline: 2px solid #FFC72C;
	border-color: #FFC72C;
}
.rr-save-primary {
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	background: #1a1a1a;
	color: #fff;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	font-family: inherit;
}
.rr-save-primary:hover:not(:disabled) { background: #004274; }
.rr-save-primary:disabled { opacity: 0.6; cursor: wait; }

/* ===== OAuth row ========================================================== */
.rr-save-oauth-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}
.rr-save-oauth {
	padding: 9px 8px;
	font-size: 13px;
	font-weight: 500;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-family: inherit;
}
.rr-save-oauth:hover { border-color: #1a1a1a; background: #fafafa; }
.rr-save-oauth svg {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	display: block;
}

/* ===== "or" divider ======================================================= */
.rr-save-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: #5b6f84;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.rr-save-divider::before,
.rr-save-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #e5e7eb;
}

/* ===== save-on-device button ============================================== */
.rr-save-cookie-btn {
	width: 100%;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
	text-align: left;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	font-family: inherit;
}
.rr-save-cookie-btn:hover { background: #f7f8fa; border-color: #1a1a1a; }
.rr-save-cookie-help {
	font-size: 12px;
	color: #5b6f84;
	margin: 8px 0 0;
	line-height: 1.4;
}
.rr-save-silent {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	font-size: 13px;
	color: #5b6f84;
	cursor: pointer;
}
.rr-save-silent input { margin: 0; }

/* ===== "magic link sent" state =========================================== */
.rr-save-sent {
	padding: 32px 22px;
	text-align: center;
}
.rr-save-sent-mark {
	font-size: 56px;
	margin: 0 0 8px;
	line-height: 1;
}
.rr-save-sent h3 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 500;
	font-size: 22px;
	margin: 0 0 8px;
	color: #1a1a1a;
}
.rr-save-sent p {
	color: #5b6f84;
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}
.rr-save-sent code {
	background: #f7f8fa;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 13px;
	color: #1a1a1a;
}
.rr-save-sent-cta {
	margin-top: 18px;
}
.rr-save-sent-cta .rr-save-cookie-btn {
	max-width: 200px;
	margin: 0 auto;
	text-align: center;
}

/* ===== error message ====================================================== */
.rr-save-err {
	margin: 0 22px 16px;
	padding: 10px 12px;
	background: #fef3c7;
	border: 1px solid #d97706;
	color: #78350f;
	border-radius: 4px;
	font-size: 13px;
}

/* ===== toast (post-save confirmation) ==================================== */
.rr-save-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #1a1a1a;
	color: #fff;
	padding: 12px 20px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
	z-index: 8500;
	max-width: calc(100vw - 32px);
}
.rr-save-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

/* ===== mobile breakpoints ================================================ */
@media (max-width: 480px) {
	.rr-save-modal { max-width: 100%; }
	.rr-save-email-row { flex-direction: column; }
	.rr-save-email-row .rr-save-primary { width: 100%; }
	.rr-save-oauth-row { grid-template-columns: 1fr; }
}
