/* ---------- Contact form: base ---------- */
.cf { display: grid; gap: 14px; text-align: left; }
.cf__title { margin: 0; font-weight: 700; font-size: 1.15em; }
.cf__intro { margin: -6px 0 0; opacity: .8; }
.cf__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cf__field { display: grid; gap: 6px; min-width: 0; }
.cf label { font-weight: 600; font-size: .92em; }
.cf input, .cf textarea { width: 100%; font: inherit; font-size: 16px; padding: 11px 13px; border-radius: 8px; border: 1px solid rgba(127, 127, 127, .4); background: rgba(255, 255, 255, .9); color: #111; min-height: 44px; }
.cf textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.cf [aria-invalid="true"] { border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.cf__help { margin: 0; font-size: 12px; opacity: .65; }
.cf__err { margin: 0; font-size: 13px; color: #e5484d; min-height: 0; }
.cf__err:empty { display: none; }
.cf__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cf__send { min-height: 46px; padding: 0 24px; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; background: #111; color: #fff; transition: transform .15s, opacity .2s; }
.cf__send:hover { transform: translateY(-1px); }
.cf__send:disabled { opacity: .6; cursor: progress; transform: none; }
.cf__status { margin: 0; font-size: 14px; }
.cf.is-sent .cf__status { color: #16a34a; font-weight: 600; }
@media (max-width: 600px) { .cf__row { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
html.cfm-open { overflow: hidden; }
.cfm { position: fixed; inset: 0; z-index: 980; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.cfm.is-open { opacity: 1; }
.cfm__card { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #fff; color: #111; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.2, .8, .2, 1); font-family: "Space Grotesk", system-ui, sans-serif; }
.cfm.is-open .cfm__card { transform: none; }
.cfm__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 0; }
.cfm__t { margin: 0; font-weight: 700; font-size: 20px; }
.cfm__x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 26px; line-height: 1; color: inherit; }
.cfm__x:hover { background: rgba(127, 127, 127, .15); }
.cfm__body { padding: 16px 20px 22px; }

/* ---------- 1986: green phosphor ---------- */
body[data-era="1986"] .cfm { background: rgba(0, 0, 0, .8); }
body[data-era="1986"] .cfm__card { background: #020703; color: #39ff6a; border: 2px solid #39ff6a; border-radius: 0; font-family: "VT323", monospace; font-size: 20px; text-shadow: 0 0 6px rgba(57, 255, 106, .5); box-shadow: 0 0 40px rgba(57, 255, 106, .25); }
body[data-era="1986"] .cf input, body[data-era="1986"] .cf textarea { background: #000; color: #39ff6a; border: 1px solid #1fae45; border-radius: 0; font-family: "VT323", monospace; font-size: 20px; }
body[data-era="1986"] .cf__send { background: #39ff6a; color: #000; border-radius: 0; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- 1996: Windows 95 + GeoCities ---------- */
body[data-era="1996"] .cfm__card { background: #c0c0c0; border: 2px outset #fff; border-radius: 0; font-family: "MS Sans Serif", Tahoma, Arial, sans-serif; box-shadow: 3px 3px 0 #000; }
body[data-era="1996"] .cfm__bar { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; padding: 4px 4px 4px 8px; }
body[data-era="1996"] .cfm__t { font-size: 14px; }
body[data-era="1996"] .cfm__x { width: 24px; height: 22px; background: #c0c0c0; color: #000; border: 2px outset #fff; border-radius: 0; font-size: 16px; }
body[data-era="1996"] .cf input, body[data-era="1996"] .cf textarea { border: 2px inset #fff; border-radius: 0; background: #fff; font-family: "Courier New", monospace; }
body[data-era="1996"] .cf__send { background: #ff22ff; color: #ffef4f; border: 3px outset #ff9cff; border-radius: 0; font-family: "Times New Roman", serif; font-size: 18px; letter-spacing: .05em; }
body[data-era="1996"] .cf__send:active { border-style: inset; }
body[data-era="1996"] .geo .cf { background: #ffffc8; border: 3px ridge #e0b000; padding: 14px; color: #000; }

/* ---------- 2006: glossy ---------- */
body[data-era="2006"] .cfm__card { font-family: "Lucida Grande", "Trebuchet MS", sans-serif; border-radius: 12px; overflow: hidden; }
body[data-era="2006"] .cfm__bar { background: linear-gradient(#5ea4ee, #2f7fd6 49%, #1d68c0 50%, #2a7ad2); color: #fff; padding: 12px 14px; }
body[data-era="2006"] .cfm__x { color: #fff; }
body[data-era="2006"] .cf input, body[data-era="2006"] .cf textarea { border: 1px solid #a9c6e8; border-radius: 6px; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .1); }
body[data-era="2006"] .cf__send { color: #fff; border: 1px solid #d86400; border-radius: 8px; background: linear-gradient(#ffaa3a 0%, #ff8a00 50%, #f07400 51%, #ff9a20 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
body[data-era="2006"] .w2 .cf label { color: #1f5fae; }

/* ---------- 2016: flat ---------- */
body[data-era="2016"] .cfm__card { font-family: Montserrat, sans-serif; border-radius: 4px; }
body[data-era="2016"] .cf input, body[data-era="2016"] .cf textarea { border-radius: 3px; border: 1px solid #d1d5db; }
body[data-era="2016"] .cf input:focus, body[data-era="2016"] .cf textarea:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
body[data-era="2016"] .cf__send { background: #10b981; border-radius: 3px; }
body[data-era="2016"] .cf__send:hover { background: #059669; }
body[data-era="2016"] .flat__contact .cf { background: #fff; color: #1f2937; padding: 28px; border-radius: 4px; max-width: 640px; margin: 36px auto 60px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); }

/* ---------- 2026: glass ---------- */
body[data-era="2026"] .cfm { background: rgba(5, 4, 15, .6); backdrop-filter: blur(6px); }
body[data-era="2026"] .cfm__card { background: rgba(26, 20, 52, .92); color: #f4f2ff; border: 1px solid rgba(255, 255, 255, .12); border-radius: 22px; box-shadow: 0 0 80px -10px rgba(167, 139, 250, .45); }
body[data-era="2026"] .cf input, body[data-era="2026"] .cf textarea { background: rgba(255, 255, 255, .06); color: #f4f2ff; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; }
body[data-era="2026"] .cf input:focus, body[data-era="2026"] .cf textarea:focus { outline: none; border-color: #67e8f9; box-shadow: 0 0 0 3px rgba(103, 232, 249, .2); }
body[data-era="2026"] .cf__send { background: linear-gradient(135deg, #67e8f9, #a78bfa); color: #0b0a1c; border-radius: 99px; }
body[data-era="2026"] .cf__err { color: #fda4af; }
body[data-era="2026"] .cf.is-sent .cf__status { color: #6ee7b7; }

/* ---------- 2036: neon ---------- */
body[data-era="2036"] .cfm { background: rgba(1, 8, 9, .75); }
body[data-era="2036"] .cfm__card { background: rgba(4, 22, 24, .95); color: #e6fffb; border: 1px solid rgba(94, 234, 212, .3); border-radius: 22px; font-family: Sora, sans-serif; box-shadow: 0 0 80px -10px rgba(94, 234, 212, .45); }
body[data-era="2036"] .cf input, body[data-era="2036"] .cf textarea { background: rgba(94, 234, 212, .06); color: #e6fffb; border: 1px solid rgba(94, 234, 212, .25); border-radius: 12px; }
body[data-era="2036"] .cf__send { background: linear-gradient(90deg, #67e8f9, #a78bfa); color: #021313; border-radius: 99px; }
body[data-era="2036"] .cf__err { color: #fda4af; }
body[data-era="2036"] .cf.is-sent .cf__status { color: #5eead4; }

/* ---------- 2046: minimal ---------- */
body[data-era="2046"] .cfm__card { font-family: "Space Grotesk", sans-serif; border-radius: 20px; }
body[data-era="2046"] .cfm__t { font-family: Orbitron, sans-serif; font-size: 15px; letter-spacing: .08em; }
body[data-era="2046"] .cf__send { background: #000; border-radius: 99px; font-family: Orbitron, sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- phones: the modal becomes a bottom sheet ---------- */
@media (max-width: 640px) {
  .cfm { place-items: end center; padding: 0; }
  .cfm__card { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .cfm.is-open .cfm__card { transform: none; }
  .cfm__bar::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: currentColor; opacity: .2; }
  .cfm__bar { position: relative; padding-top: 22px; }
  body[data-era="1986"] .cfm__card, body[data-era="1996"] .cfm__card { border-radius: 0; }
}
