/* ── Site Canvas — felles for XxxNorway / MyDomina / Fettegodt ── */
a { text-decoration: none; color: inherit; }
:root {
    --sc-accent: #c9a227;
    --sc-accent2: #a07a10;
    --sc-bg: #080808;
    --sc-text: #f0ece8;
    --sc-muted: #7a7060;
}

/* ── Canvas-side (forside) ── */
.sc-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background: var(--sc-bg);
    font-family: system-ui, -apple-system, sans-serif;
}

.sc-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: background 0.3s;
}

/* dim-overlay for readability when bg-image is set */
.sc-bg-layer.has-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.42);
}

.sc-blocks {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ── Blocks ── */
.sc-block {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: default;
    user-select: none;
    pointer-events: auto;
}

.sc-block.is-admin {
    cursor: grab;
}

.sc-block.is-admin:hover {
    outline: 1px dashed rgba(212, 181, 106, 0.45);
    outline-offset: 3px;
}

.sc-block.is-selected {
    outline: 2px solid rgba(212, 181, 106, 0.85) !important;
    outline-offset: 3px;
}

.sc-block.is-dragging {
    cursor: grabbing;
    z-index: 100;
    outline: 2px solid #d4b56a !important;
}

/* Text block */
.sc-text-node {
    color: #fff;
    font-weight: 700;
    outline: none;
    min-width: 2ch;
    text-align: center;
    white-space: pre-wrap;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6);
    cursor: inherit;
    line-height: 1.15;
}

.sc-text-node[contenteditable="true"] {
    cursor: text;
    background: rgba(0,0,0,0.18);
    border-radius: 0.3rem;
    padding: 0.1rem 0.2rem;
}

/* Image block */
.sc-image-node {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    border-radius: 0.4rem;
}

/* Resize handle */
.sc-resize-handle {
    position: absolute;
    bottom: -7px;
    right: -7px;
    width: 16px;
    height: 16px;
    background: #d4b56a;
    border-radius: 3px;
    cursor: nwse-resize;
    display: none;
    z-index: 10;
}

.sc-block.is-selected .sc-resize-handle {
    display: block;
}

/* ── Per-block toolbar ── */
.sc-block-toolbar {
    position: absolute;
    top: calc(-100% - 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 0.25rem;
    background: rgba(10, 8, 14, 0.95);
    border: 1px solid rgba(212, 181, 106, 0.38);
    border-radius: 0.45rem;
    padding: 0.22rem 0.35rem;
    white-space: nowrap;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.sc-block.is-selected .sc-block-toolbar {
    display: flex;
}

.sc-tb-btn {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    color: #f0ece2;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0;
    line-height: 1;
}

.sc-tb-btn:hover {
    background: rgba(212, 181, 106, 0.18);
}

.sc-tb-btn.is-del {
    color: #cc4444;
    border-color: rgba(204, 68, 68, 0.4);
}

.sc-tb-size {
    height: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #f0ece2;
    border-radius: 0.28rem;
    padding: 0 0.3rem;
    font-size: 0.62rem;
    cursor: pointer;
}

.sc-tb-color {
    width: 2rem;
    height: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.28rem;
    padding: 0 0.1rem;
    cursor: pointer;
    background: none;
}

.sc-tb-weight {
    height: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #f0ece2;
    border-radius: 0.28rem;
    padding: 0 0.3rem;
    font-size: 0.62rem;
    cursor: pointer;
}

/* ── Admin bar (fast bunn-linje) ── */
.sc-admin-bar {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10, 8, 14, 0.93);
    border: 1px solid rgba(212, 181, 106, 0.42);
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
    white-space: nowrap;
}

.sc-admin-btn {
    height: 1.8rem;
    padding: 0 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(212, 181, 106, 0.45);
    background: transparent;
    color: #d4b56a;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: background 0.15s;
}

.sc-admin-btn:hover {
    background: rgba(212, 181, 106, 0.12);
}

.sc-admin-btn.is-save {
    background: #d4b56a;
    color: #111;
    border-color: #d4b56a;
    font-weight: 700;
}

.sc-admin-btn.is-save:hover {
    background: #c4a558;
}

.sc-admin-btn.is-saved {
    background: #2a6a3a;
    color: #90e0a0;
    border-color: #2a6a3a;
}

.sc-bg-color-in {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    border: 1px solid rgba(212,181,106,0.45);
    padding: 0;
    cursor: pointer;
    background: none;
}

/* ── Gate (innlogging/registrering knapper) ── */
.sc-gate {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    pointer-events: auto;
    flex-wrap: wrap;
}

.sc-gate-btn {
    padding: 0.62rem 1.8rem;
    border-radius: 2rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: all 0.18s;
    display: inline-block;
}

.sc-gate-btn.is-primary {
    background: var(--sc-accent);
    color: #111;
    border: none;
}

.sc-gate-btn.is-primary:hover {
    background: var(--sc-accent2);
}

.sc-gate-btn.is-ghost {
    background: transparent;
    color: var(--sc-accent);
    border: 1.5px solid var(--sc-accent);
}

.sc-gate-btn.is-ghost:hover {
    background: rgba(212, 181, 106, 0.1);
}

/* Visitor: klikkbare elementer i canvas-blokkene deaktivert (ikke innloggingsskjema/nav/footer) */
.sc-page.is-visitor .sc-blocks a:not(.sc-gate-btn),
.sc-page.is-visitor .sc-blocks button:not(.sc-gate-btn) {
    pointer-events: none;
    cursor: default;
}

/* ── Innlogging / Registrering side ── */
.sc-auth-page {
    min-height: 100vh;
    background: #080808;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: system-ui, -apple-system, sans-serif;
}

.sc-auth-card {
    width: 100%;
    max-width: 22rem;
    background: rgba(18, 14, 26, 0.92);
    border: 1px solid rgba(212, 181, 106, 0.3);
    border-radius: 1rem;
    padding: 2rem 2rem 1.6rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.sc-auth-brand {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #d4b56a;
    margin-bottom: 1.6rem;
    text-transform: uppercase;
}

.sc-auth-card .stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sc-auth-card label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: #7a7672;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sc-auth-card input[type="email"],
.sc-auth-card input[type="password"],
.sc-auth-card input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f0ece2;
    border-radius: 0.45rem;
    padding: 0.58rem 0.75rem;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.sc-auth-card input:focus {
    border-color: #d4b56a;
}

.sc-auth-card .btn {
    background: #d4b56a;
    color: #111;
    border: none;
    padding: 0.68rem;
    border-radius: 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
}

.sc-auth-card .btn:hover {
    background: #c4a558;
}

.sc-auth-card .btn.ghost {
    background: transparent;
    color: #d4b56a;
    border: 1.5px solid rgba(212, 181, 106, 0.5);
    margin-top: 0.1rem;
}

.sc-auth-card .btn.ghost:hover {
    background: rgba(212, 181, 106, 0.08);
}

.sc-auth-card .btn-row {
    display: flex;
    gap: 0.5rem;
}

.sc-auth-card .btn-row .btn {
    flex: 1;
}

.sc-auth-card .muted {
    text-align: center;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: #6a6360;
}

.sc-auth-card .muted a {
    color: #d4b56a;
    text-decoration: none;
}

.sc-auth-card .error {
    color: #e45555;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.sc-auth-card .check-row {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #8a8680;
    text-transform: none;
    letter-spacing: 0;
}

.sc-auth-card .age-note {
    font-size: 0.68rem;
    color: #5a5856;
    text-align: center;
    margin-top: 0.3rem;
}

.sc-auth-back {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #6a6360;
    text-decoration: none;
}

.sc-auth-back:hover {
    color: #d4b56a;
}

/* Passord-wrapper */
.sc-auth-card .pw-wrap {
    position: relative;
}

.sc-auth-card .pw-wrap input {
    padding-right: 2.5rem;
}

.sc-auth-card .pw-eye {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6a6360;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}
