/* Miruro — sign-in modal (#sign) + error pages. Linked from frontend/partials/auth-modal (every
   layouts.hoshi page), imported by mr-pages.css and linked by errors/partials/standalone.
   Measured on the reference (miruro.cx) at 1440 / 1280 / 1024 / 768 / 390:
   - sign-in dialog: 768px wide, page-colour fill, 1px hairline, 8px radius, 50% black scrim;
     artwork pane | content pane (28px padding, 24px under 640px, 20px gaps); 24/32 900 title,
     14/22.75 muted lead, 44px controls with 10px radius; under 640px a 144px artwork strip on top.
   - 404: clamp(10rem, 38vw, 22rem) 900 numerals, 64px 24px padding, 24/32 750 title,
     14/22.75 note (max 384px), 40px buttons (7px radius) 56px below.
   Colours are the shell tokens from miruro.css (dark + light). */

.mr {
    --mr-x-card: var(--mr-card, var(--hs-bg-2));
    --mr-x-line: var(--mr-border, var(--hs-line-2));
    --mr-x-ac: var(--mr-primary, var(--hs-ac));
    --mr-x-ac-ink: var(--mr-primary-ink, #121113);
}

/* ============ sign-in modal ============ */
.mr #sign.hs-modal .modal-dialog { max-width: 768px; margin: 16px auto; padding: 0 16px; min-height: calc(100% - 32px); }
@media (min-width: 640px) { .mr #sign.hs-modal .modal-dialog { padding: 0; } }
.mr #sign.hs-modal .modal-content {
    position: relative; display: grid; grid-template-columns: 1fr; min-height: 0; overflow: hidden;
    background: var(--hs-bg); border: 1px solid var(--hs-line); border-radius: var(--mr-r-lg, 8px) !important; box-shadow: none; color: var(--hs-tx);
}
.mr #sign.hs-modal .modal-content[style*="display: none"] { display: none !important; }
@media (min-width: 640px) { .mr #sign.hs-modal .modal-content { grid-template-columns: 1fr 1fr; min-height: 574px; } }
html[data-theme="light"] .mr #sign.hs-modal .modal-content { background: var(--hs-bg) !important; border-color: var(--hs-line) !important; }
body.mr:has(#sign.show) .modal-backdrop.show { opacity: 1; background: rgba(0, 0, 0, 0.5); }

/* artwork pane: a tilted collage of our own popular posters */
.mr-am-art { position: relative; height: 144px; overflow: hidden; background: var(--mr-x-card); }
@media (min-width: 640px) { .mr-am-art { height: auto; min-height: 100%; } }
.mr-am-art .mr-am-col { position: absolute; top: -12%; display: flex; flex-direction: column; gap: 8px; width: 36%; }
.mr-am-art .mr-am-col:nth-child(1) { left: -6%; transform: translateY(-4%); }
.mr-am-art .mr-am-col:nth-child(2) { left: 32%; transform: translateY(-16%); }
.mr-am-art .mr-am-col:nth-child(3) { left: 70%; transform: translateY(-8%); }
.mr-am-art .mr-am-col { rotate: -8deg; }
.mr-am-art img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--mr-r-lg, 8px); background: var(--hs-bg-3); }
@media (max-width: 639px) {
    .mr-am-art .mr-am-col { top: -60%; width: 34%; }
    .mr-am-art .mr-am-col:nth-child(1) { left: -2%; }
    .mr-am-art .mr-am-col:nth-child(2) { left: 33%; }
    .mr-am-art .mr-am-col:nth-child(3) { left: 68%; }
}
.mr-am-fade { position: absolute; inset: 0; background: linear-gradient(to top, var(--hs-bg), rgba(var(--mr-rgb, 18, 17, 19), 0.2) 50%, transparent); }
@media (min-width: 640px) { .mr-am-fade { background: linear-gradient(to left, rgba(var(--mr-rgb, 18, 17, 19), 0.45), transparent 40%); } }

/* content pane */
.mr-am-bd { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 24px; }
@media (min-width: 640px) { .mr-am-bd { padding: 28px; } }
.mr-am-x {
    position: absolute; top: 17px; right: 17px; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; padding: 0; border: 0; font-size: 16px; line-height: 24px; border-radius: 2px; background: none; color: var(--hs-tx); opacity: 0.8; cursor: pointer; transition: opacity 0.15s; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.mr-am-x:hover { opacity: 1; }
.mr-am-head { display: flex; flex-direction: column; gap: 6px; }
.mr .mr-am-title { margin: 0; padding-right: 12px; font: 900 24px/32px var(--hs-f-head); letter-spacing: -0.025em; color: var(--hs-tx); }
.mr-am-lead { margin: 0; font-size: 14px; line-height: 22.75px; color: var(--hs-tx-3); }
.mr-am-foot { margin: auto 0 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--hs-tx-3); text-align: center; }

/* fields + buttons (modal, contact, reset password) */
.mr .mr-am-form, .mr .mr-fm { gap: 12px; }
.mr .mr-am-form .hs-field, .mr .mr-fm .hs-field { gap: 6px; font-size: 14px; line-height: 17.5px; font-weight: 600; color: var(--hs-tx); }
.mr .mr-am-form .hs-field input, .mr .mr-fm .hs-field input, .mr .mr-fm .hs-field textarea {
    height: 44px; padding: 0 14px; border: 1px solid var(--mr-x-line); border-radius: var(--mr-r-xl, 10px);
    background: var(--mr-x-card); color: var(--hs-tx); font: 400 14px var(--hs-f-body); box-shadow: none; transition: border-color 0.15s;
}
.mr .mr-fm .hs-field textarea { height: auto; min-height: 132px; padding: 12px 14px; line-height: 1.5; }
.mr .mr-am-form .hs-field input::placeholder, .mr .mr-fm .hs-field input::placeholder, .mr .mr-fm .hs-field textarea::placeholder { color: var(--hs-tx-5, var(--hs-tx-4)); opacity: 1; }
.mr .mr-am-form .hs-field input:focus, .mr .mr-fm .hs-field input:focus, .mr .mr-fm .hs-field textarea:focus { border-color: var(--mr-x-ac); outline: none; }
.mr .mr-am-form .hs-form-2, .mr .mr-fm .hs-form-2 { gap: 12px; }
@media (max-width: 400px) { .mr .mr-am-form .hs-form-2 { grid-template-columns: 1fr; } }
.mr .mr-am-form .hs-form-row { font-size: 12px; }
.mr .mr-am-form .hs-check, .mr .mr-fm .hs-check { gap: 8px; font-size: 12px; line-height: 16.5px; font-weight: 500; color: var(--hs-tx-3); }
.mr .mr-am-form .hs-check input[type=checkbox], .mr .mr-fm .hs-check input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--mr-x-ac); }
.mr .mr-am .hs-link, .mr .mr-fm .hs-link, .mr .mr-rs .hs-link { color: var(--hs-tx) !important; font-weight: 600; text-decoration: underline; text-decoration-color: var(--mr-x-line); text-underline-offset: 3px; }
.mr .mr-am .hs-link:hover, .mr .mr-fm .hs-link:hover, .mr .mr-rs .hs-link:hover { text-decoration-color: currentColor; }
.mr .mr-am-go, .mr .mr-fm-go {
    height: 44px; padding: 0 16px; gap: 10px; border: 0; border-radius: var(--mr-r-xl, 10px);
    background: var(--mr-x-ac); color: var(--mr-x-ac-ink) !important; font: 700 14px var(--hs-f-body); box-shadow: none;
}
.mr .mr-am-go:hover, .mr .mr-fm-go:hover { background: var(--mr-x-ac); filter: brightness(1.08); }
.mr .mr-am-go:disabled, .mr .mr-fm-go:disabled { opacity: 0.6; cursor: default; }
.mr .mr-am-social { display: flex; flex-direction: column; gap: 8px; }
.mr .mr-am-social .hs-btn {
    width: 100%; height: 44px; padding: 0 16px; gap: 10px; border: 1px solid var(--mr-x-line); border-radius: var(--mr-r-xl, 10px);
    background: var(--mr-x-card); color: var(--hs-tx) !important; font: 700 14px var(--hs-f-body);
}
.mr .mr-am-social .hs-btn:hover { background: var(--mr-muted, var(--hs-bg-3)); }

/* validation / status messages (main.js prepends .alert into the form) */
.mr #sign .alert, .mr .mr-fm .alert, .mr .mr-msg {
    margin: 0; padding: 10px 36px 10px 12px; border: 1px solid; border-radius: var(--mr-r-lg, 8px); font-size: 13px; line-height: 1.45; font-weight: 500;
}
.mr .mr-msg { padding-right: 12px; }
.mr #sign .alert-danger, .mr .mr-fm .alert-danger, .mr .mr-msg.err { color: var(--mr-red, #F87171); border-color: color-mix(in srgb, var(--mr-red, #F87171) 35%, transparent); background: color-mix(in srgb, var(--mr-red, #F87171) 9%, transparent); }
.mr #sign .alert-success, .mr .mr-fm .alert-success, .mr .mr-msg.ok { color: var(--mr-green, #22C55E); border-color: color-mix(in srgb, var(--mr-green, #22C55E) 35%, transparent); background: color-mix(in srgb, var(--mr-green, #22C55E) 9%, transparent); }
.mr #sign .alert-info, .mr .mr-fm .alert-info { color: var(--hs-tx-2); border-color: var(--mr-x-line); background: var(--mr-x-card); }
.mr #sign .alert .close { top: 50%; right: 6px; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; border-radius: 4px; font-size: 18px; line-height: 1; opacity: 0.75; }
.mr #sign .alert .close:hover { opacity: 1; }

/* ============ error pages (404 + errors/partials/error-page) ============ */
.mr-err { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.mr-err-code { display: block; margin: 0; font: 900 clamp(10rem, 38vw, 22rem)/1 var(--hs-f-head); letter-spacing: normal; color: var(--hs-tx); user-select: none; }
.mr .mr-err-msg { margin: 32px 0 0; font: 750 24px/32px var(--hs-f-head); letter-spacing: -0.025em; color: var(--hs-tx); overflow-wrap: anywhere; }
.mr-err-note { max-width: 384px; margin: 12px 0 0; font-size: 14px; line-height: 22.75px; color: var(--hs-tx-3); }
.mr-err-ac { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 56px; }
.mr-err-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
    border: 1px solid var(--mr-x-line); border-radius: var(--mr-r-md, 7px); background: color-mix(in srgb, var(--mr-x-line) 30%, transparent);
    color: var(--hs-tx) !important; font: 600 14px/20px var(--hs-f-body); text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color 0.15s, scale 0.15s;
}
.mr-err-btn:hover { background: color-mix(in srgb, var(--mr-x-line) 50%, transparent); }
.mr-err-btn:active { scale: 0.97; }
.mr-err-btn svg { flex: 0 0 16px; width: 16px; height: 16px; }
.mr-err-btn.is-p { border: 0; background: var(--mr-x-ac); color: var(--mr-x-ac-ink) !important; }
.mr-err-btn.is-p:hover { background: var(--mr-x-ac); filter: brightness(1.08); }
/* standalone (500 / 503) shell: no header or footer around it */
.mr-err-solo { min-height: 100vh; min-height: 100svh; }
