/*
=========================================================
POPUP STYLESHEET - Joshua Dalton Media
=========================================================

Purpose
-------
Lead-magnet email capture popup for the homepage. Dark
glassmorphism modal with accent CTA, backdrop blur overlay,
and mobile-first responsive layout.

What belongs in this file
-------------------------
- Popup overlay and backdrop
- Panel shell and animation
- Close button
- Copy block
- Form fields and submit
- Success state
- Side tab trigger
- Responsive rules
- Reduced motion

Asset path usage
----------------
This stylesheet is intended to be referenced from pages with:

<link rel="stylesheet" href="/assets/css/popup.css">

Relationship to page files
--------------------------
Page files should:
1. Load this stylesheet after global.css
2. Use this stylesheet on pages with the popup component
3. Keep shared form styling in forms.css

Maintenance rule
----------------
If reusable across multiple popup types, consider a shared
popup stylesheet.
*/

/* ================= OVERLAY ================= */
.pm-overlay{position:fixed;inset:0;z-index:250;display:flex;align-items:center;justify-content:center;padding:12px}
.pm-overlay[hidden]{display:none}
.pm-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}

/* ================= PANEL ================= */
.pm-panel{position:relative;z-index:1;width:100%;max-width:440px;border-radius:20px;overflow:hidden;background:linear-gradient(180deg, rgba(18,18,18,.97), rgba(14,14,14,.95));border:1px solid rgba(255,255,255,.1);box-shadow:0 24px 80px rgba(0,0,0,.55);opacity:0;transform:translateY(20px);transition:opacity .35s ease, transform .35s ease}
.pm-overlay.is-open .pm-panel{opacity:1;transform:translateY(0)}
.pm-inner{display:grid;gap:16px;padding:24px 20px}
body.pm-open{overflow:hidden}

/* ================= CLOSE ================= */
.pm-close{position:absolute;top:12px;right:12px;z-index:3;display:grid;place-items:center;width:32px;height:32px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);color:var(--muted);font-size:18px;line-height:1;cursor:pointer;transition:background .15s, color .15s}
.pm-close:hover{background:rgba(255,255,255,.12);color:var(--ink)}

/* ================= COPY ================= */
.pm-copy{display:grid;gap:8px;padding-right:28px}
.pm-kicker{font-size:.68rem;line-height:1.2;letter-spacing:.12em;text-transform:uppercase;font-weight:800;color:var(--accent)}
.pm-title{margin:0;font-size:clamp(1.05rem, 4.5vw, 1.25rem);line-height:1.15;color:var(--ink)}
.pm-desc{margin:0;font-size:.82rem;line-height:1.5;color:var(--muted)}

/* ================= FORM ================= */
.pm-form{display:grid;gap:10px}
.pm-field{display:grid;gap:5px}
.pm-label{font-size:.76rem;line-height:1.25;color:var(--muted);font-weight:700}
.pm-input{width:100%;min-height:46px;padding:12px;border-radius:10px;border:1px solid rgba(255,255,255,.12);background:rgba(10,10,10,.7);color:var(--ink);font:inherit;font-size:16px;line-height:1.35;transition:border-color .18s, box-shadow .18s}
.pm-input::placeholder{color:rgba(255,255,255,.4)}
.pm-input:focus{outline:none;border-color:rgba(255,77,77,.55);box-shadow:0 0 0 3px rgba(255,77,77,.14)}
.pm-submit{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:.6em 1.2em;background:var(--accent);color:#fff;border:2px solid var(--accent);border-radius:999px;font-weight:800;font-size:14px;line-height:1.2;cursor:pointer;transition:filter .15s}
.pm-submit:hover{filter:brightness(1.08)}
.pm-submit:disabled{opacity:.7;cursor:default}
.pm-disclaimer{margin:0;font-size:.68rem;line-height:1.4;color:var(--muted);opacity:.7}

/* ================= SUCCESS STATE ================= */
.pm-success{display:grid;gap:12px;text-align:center;justify-items:center;padding:8px 0}
.pm-success-icon{animation:pmPop .4s cubic-bezier(.34,1.56,.64,1) both}
@keyframes pmPop{0%{opacity:0;transform:scale(.5)} 100%{opacity:1;transform:scale(1)}}
.pm-success-title{margin:0;font-size:1.1rem;line-height:1.2;color:var(--ink)}
.pm-success-text{margin:0;font-size:.84rem;line-height:1.5;color:var(--muted)}

/* ================= SIDE TAB ================= */
.pm-side-tab{position:fixed;bottom:0;left:0;z-index:200;width:62px;height:62px;background:linear-gradient(45deg, var(--accent) 50%, transparent 50%);border:0;cursor:pointer;display:flex;align-items:flex-end;justify-content:flex-start;padding:8px 0 6px 6px;color:#fff;font:inherit;font-size:.54rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;line-height:1.15;white-space:pre;filter:drop-shadow(0 -4px 12px rgba(255,77,77,.3)) drop-shadow(0 -14px 40px rgba(255,77,77,.14));transition:opacity .25s, transform .25s, filter .2s}
.pm-side-tab:hover{filter:brightness(1.1) drop-shadow(0 -4px 12px rgba(255,77,77,.4)) drop-shadow(0 -14px 40px rgba(255,77,77,.2))}
.pm-side-tab.is-nudge{animation:pmNudge .5s ease}
@keyframes pmNudge{0%,100%{transform:translate(0,0) rotate(0)} 20%{transform:translate(-2px,1px) rotate(-2deg)} 40%{transform:translate(2px,-1px) rotate(2deg)} 60%{transform:translate(-1px,1px) rotate(-1deg)} 80%{transform:translate(1px,0) rotate(1deg)}}
.pm-side-tab.is-hidden{opacity:0;pointer-events:none;transform:translate(-12px, 12px)}

/* ================= RESPONSIVE BREAKPOINTS ================= */

@media(min-width:360px){
	/* ================= PANEL ================= */
	.pm-inner{padding:28px 24px}
}

@media(min-width:700px){
	/* ================= OVERLAY ================= */
	.pm-overlay{align-items:center;padding:24px}
	/* ================= PANEL ================= */
	.pm-panel{max-width:460px}
	.pm-inner{padding:32px 28px;gap:18px}
	/* ================= COPY ================= */
	.pm-title{font-size:1.25rem}
	/* ================= SIDE TAB ================= */
	.pm-side-tab{width:80px;height:80px;padding:10px 0 8px 8px;font-size:.66rem}
}

@media(min-width:1024px){
	/* No additional overrides required at this breakpoint */
}

@media(prefers-reduced-motion:reduce){
	/* ================= PANEL ================= */
	.pm-panel{transition:none}
	/* ================= SUCCESS STATE ================= */
	.pm-success-icon{animation:none}
	/* ================= SIDE TAB ================= */
	.pm-side-tab.is-nudge{animation:none}
}
