/* The Marriage Biodata maker (src/components/BiodataMaker.astro). It sits in the Nova Space page and uses its colours (--text, --text-2, --bg-2, --border, --accent). */
.bd { --bd-r: 16px; margin: 8px 0 40px; scroll-margin-top: 80px; min-width: 0; max-width: 100%; }
.bd-designs-wrap, .bd-main, .bd-form, .bd-preview { min-width: 0; }
.bd-nojs { padding: 14px; border: 1px solid var(--border); border-radius: var(--bd-r); }
.bd-h { margin: 0 0 4px; font-family: var(--sp-head, inherit); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.bd-hint { margin: 4px 0 10px; font-size: 14px; color: var(--text-2); }

/* the designs: a row that slides sideways */
.bd-designs { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.bd-design { position: relative; flex: 0 0 auto; width: 112px; scroll-snap-align: start; cursor: pointer; text-align: center; }
.bd-design input { position: absolute; opacity: 0; pointer-events: none; }
.bd-thumb { display: block; width: 112px; height: 158px; border-radius: 12px; overflow: hidden; border: 3px solid transparent; box-shadow: 0 6px 18px -8px rgba(0,0,0,.45); transition: border-color .15s; }
.bd-thumb canvas { display: block; width: 100%; height: 100%; }
.bd-design b { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--text-2); }
.bd-design input:checked + .bd-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 8px 22px -8px rgba(0,0,0,.5); }
.bd-design input:checked ~ b { color: var(--text); }
.bd-design input:focus-visible + .bd-thumb { outline: 3px solid var(--sp-cyan, var(--accent)); outline-offset: 2px; }

/* the form and the preview: side by side on a wide screen, one under the other on a phone */
.bd-main { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .bd-main { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: start; } .bd-preview { position: sticky; top: 84px; } }
.bd-group { border: 1px solid var(--border); border-radius: var(--bd-r); background: var(--bg-2); margin-bottom: 12px; }
.bd-group > summary { cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.bd-group > summary::-webkit-details-marker { display: none; }
.bd-group > summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--accent); }
.bd-group[open] > summary::after { content: '−'; }
.bd-group > :not(summary) { margin-left: 16px; margin-right: 16px; }
.bd-group > :last-child { margin-bottom: 16px; }
.bd-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .bd-grid { grid-template-columns: 1fr 1fr; } .bd-f.wide { grid-column: 1 / -1; } }
.bd-f { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.bd-f input, .bd-f select, .bd-f textarea, .bd-mrow input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; font-weight: 400; }
.bd-f textarea { resize: vertical; min-height: 72px; }
.bd-f input:focus, .bd-f select:focus, .bd-f textarea:focus, .bd-mrow input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.bd-mrow { display: grid; grid-template-columns: 1fr 1.6fr 44px; gap: 8px; margin-bottom: 8px; }
.bd-x { min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: none; color: var(--text-2); cursor: pointer; font-size: 15px; }
.bd-photo-row { display: flex; gap: 10px; flex-wrap: wrap; }

.bd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-align: center; }
.bd-btn:disabled { opacity: .55; cursor: default; }
.bd-pick, .bd-go { color: #fff; border-color: transparent; background-color: var(--sp-btn-solid, #6a2fe0); background-image: var(--sp-btn, linear-gradient(100deg, #0061d6, #6a2fe0 55%, #c8106a)); box-shadow: 0 10px 26px -12px rgba(155,92,255,.8); }
.bd-ghost { background: none; }
.bd-link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }

/* on a phone the preview is under the form: a button at the bottom goes to it while the form is on the screen */
.bd-peek { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: inline-flex; align-items: center; min-height: 48px; padding: 10px 22px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; background-color: var(--sp-btn-solid, #6a2fe0); background-image: var(--sp-btn, linear-gradient(100deg, #0061d6, #6a2fe0 55%, #c8106a)); box-shadow: 0 12px 30px -10px rgba(0,0,0,.55); }
.bd-peek[hidden] { display: none; }
@media (min-width: 960px) { .bd-peek { display: none !important; } }
.bd-paper { border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px -24px rgba(0,0,0,.55); border: 1px solid var(--border); background: #fff; }
.bd-paper canvas { display: block; width: 100%; height: auto; }
.bd-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bd-out .bd-go { grid-column: 1 / -1; }
.bd-msg { min-height: 20px; margin: 10px 2px 0; font-size: 14px; color: #b45309; }
.bd-msg.ok { color: #15803d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bd-msg { color: #fbbf24; } :root:not([data-theme="light"]) .bd-msg.ok { color: #4ade80; } }
:root[data-theme="dark"] .bd-msg { color: #fbbf24; } :root[data-theme="dark"] .bd-msg.ok { color: #4ade80; }
@media (max-width: 380px) { .bd-out { grid-template-columns: 1fr; } .bd-mrow { grid-template-columns: 1fr 44px; } .bd-mrow input:nth-child(2) { grid-column: 1; } }
