/* ============================================================
   ApnaBiodata — css/templates.css
   Template gallery + biodata paper: .template-grid, .tcard,
   .tpreview, .biodata-paper, template thumbnail scaling
   (.tscale), corner ornaments (.bio-corner), the FREE badge
   and the live-preview frame.
   ============================================================ */
.template-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
@media(max-width:900px){.template-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.template-grid{grid-template-columns:1fr}}
.tcard{background:#fff;border-radius:6px;overflow:hidden;border:1px solid var(--line);box-shadow:0 6px 0 -2px #FAF3E3,0 14px 28px rgba(59,32,16,.1);transition:transform .35s,box-shadow .35s,border-color .35s;cursor:pointer;position:relative}
.tcard::after{content:"";position:absolute;inset:0;border:1px solid transparent;transition:.35s;pointer-events:none}
.tcard:hover{transform:translateY(-7px);box-shadow:0 6px 0 -2px #F1E3BC,0 24px 44px rgba(59,32,16,.16);border-color:var(--gold)}
.tcard:hover::after{border-color:rgba(193,154,61,.65);inset:5px}
.tpreview{height:210px;padding:14px;position:relative;overflow:hidden}
.tpreview-inner{background:#fffdf7;height:100%;border-radius:4px;padding:12px;border:2px solid rgba(0,0,0,.08);font-size:11px;line-height:1.5}
.biodata-paper{background:#fffdf8;border-radius:6px;box-shadow:0 20px 50px rgba(59,32,16,.18);padding:28px;position:relative;overflow:hidden;font-size:13px;line-height:1.6}
.biodata-paper h3{text-align:center;font-size:22px}
.tpreview{height:236px}
.tscale{width:278%;transform:scale(.36);transform-origin:top left;pointer-events:none}
.tscale .biodata-paper{box-shadow:none}
.freebadge{position:absolute;top:10px;right:10px;background:var(--maroon);color:#F3D27A;font-size:10px;font-weight:800;padding:4px 9px;border-radius:999px;z-index:5;letter-spacing:.06em}
.bio-corner{position:absolute;width:48px;height:48px;z-index:2;pointer-events:none}
.biodata-paper h1,.biodata-paper h2,.mini-bio h1,.mini-bio h2{background:none;-webkit-background-clip:initial;background-clip:initial}
.tcard{background:#fff;border-color:#e9e9f2;box-shadow:0 14px 30px rgba(30,27,75,.09);transform-style:preserve-3d;will-change:transform}
.tcard::before{content:"";position:absolute;inset:0;background:radial-gradient(340px circle at var(--mx,50%) var(--my,50%),rgba(255,255,255,.5),transparent 45%);opacity:0;transition:opacity .3s;pointer-events:none;z-index:4}
.tcard:hover::before{opacity:1}
.tcard:hover{border-color:#a855f7;box-shadow:0 28px 48px rgba(124,58,237,.22),0 0 26px rgba(236,72,153,.14)}
.tcard:hover::after{border-color:rgba(168,85,247,.6);inset:5px}
.freebadge{background:linear-gradient(120deg,#7c3aed,#db2777);color:#fff}
@media (prefers-reduced-motion: no-preference){.template-grid .tcard{animation:cardFlipIn .65s cubic-bezier(.2,.8,.2,1) both}
.template-grid .tcard:nth-child(4n+2){animation-delay:.06s}
.template-grid .tcard:nth-child(4n+3){animation-delay:.12s}
.template-grid .tcard:nth-child(4n){animation-delay:.18s}}
#livePreview{padding:3px;border-radius:12px;background:linear-gradient(140deg,#7c3aed,#ec4899,#06b6d4,#f59e0b);box-shadow:0 22px 44px rgba(124,58,237,.20)}
#livePreview .biodata-paper{border-radius:9px}
@media(max-width:700px){.template-grid .tcard{animation-duration:.4s}}
