@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --swbrreg-accent: #2563EB;
    --swbrreg-accent-hover: #1D4ED8;
    --swbrreg-ink: #0F172A;
    --swbrreg-body: #334155;
    --swbrreg-muted: #64748B;
    --swbrreg-soft: #94A3B8;
    --swbrreg-border: #E2E8F0;
    --swbrreg-border-strong: #CBD5E1;
    --swbrreg-field: #FFFFFF;
    --swbrreg-page: #EEF1F6;
    --swbrreg-success: #16A34A;
    --swbrreg-success-text: #15803D;
    --swbrreg-success-bg: #ECFDF5;
    --swbrreg-success-border: #A7F3D0;
    --swbrreg-warning-bg: #FFFBEB;
    --swbrreg-warning-border: #FDE68A;
    --swbrreg-warning-text: #92400E;
    --swbrreg-danger: #B91C1C;
    --swbrreg-danger-bg: #FEF2F2;
    --swbrreg-danger-border: #FECACA;
    --swbrreg-tag-bg: #EFF6FF;
    --swbrreg-tag-border: #DBEAFE;
}

.swbrreg-box,
.swbrreg-registration,
.swbrreg-box *,
.swbrreg-registration * { box-sizing: border-box; }

.swbrreg-box,
.swbrreg-registration {
    font-family: 'Public Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: var(--swbrreg-ink) !important;
    -webkit-font-smoothing: antialiased;
}

.swbrreg-box {
    clear: both;
    background: #fff !important;
    border: 1px solid var(--swbrreg-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 40px -24px rgba(15,23,42,.22) !important;
    margin: 0 0 24px !important;
    overflow: hidden;
}

.swbrreg-registration { margin: 14px 0 18px !important; }

.swbrreg-box__header {
    padding: 24px 28px 21px !important;
    border-bottom: 1px solid #EEF2F7 !important;
    margin: 0 !important;
}

.swbrreg-box__header h3 {
    margin: 0 !important;
    color: var(--swbrreg-ink) !important;
    font-size: 23px !important;
    line-height: 1.18 !important;
    font-weight: 800 !important;
    letter-spacing: -.4px !important;
}

.swbrreg-box__header p {
    margin: 8px 0 0 !important;
    color: var(--swbrreg-muted) !important;
    font-size: 14.5px !important;
    line-height: 1.5 !important;
}

.swbrreg-eyebrow,
.swbrreg-field-section__title,
.swbrreg-result-list__title,
.swbrreg-result-list__count,
.swbrreg-selected__label {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-transform: uppercase !important;
}

.swbrreg-eyebrow {
    display: inline-flex !important;
    width: fit-content;
    align-items: center;
    border: 1px solid var(--swbrreg-tag-border);
    background: var(--swbrreg-tag-bg);
    color: var(--swbrreg-accent);
    border-radius: 999px;
    padding: 3px 9px;
    margin: 0 0 10px;
}

.swbrreg-type-section,
.swbrreg-field-section,
.swbrreg-registration-panel,
.swbrreg-business-panel {
    margin: 0 !important;
}

.swbrreg-registration > .swbrreg-field-section,
.swbrreg-registration > .swbrreg-type-section,
.swbrreg-registration > .swbrreg-registration-panel,
.swbrreg-registration > .swbrreg-registration-fields,
.swbrreg-box > .swbrreg-type,
.swbrreg-box > .swbrreg-business-panel {
    margin-left: 28px !important;
    margin-right: 28px !important;
}

.swbrreg-registration > .swbrreg-field-section:first-of-type,
.swbrreg-registration > .swbrreg-type-section:first-of-type,
.swbrreg-registration > .swbrreg-registration-panel:first-of-type,
.swbrreg-box > .swbrreg-type:first-of-type,
.swbrreg-box > .swbrreg-business-panel:first-of-type { margin-top: 24px !important; }

.swbrreg-registration > .swbrreg-registration-fields,
.swbrreg-registration > .swbrreg-registration-panel,
.swbrreg-registration > .swbrreg-field-section,
.swbrreg-registration > .swbrreg-type-section { margin-bottom: 26px !important; }

.swbrreg-type {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px !important;
    background: #F1F5F9 !important;
    border-radius: 12px !important;
    padding: 4px !important;
    margin-bottom: 18px !important;
}

.swbrreg-type__option {
    appearance: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    padding: 9px 14px !important;
    color: var(--swbrreg-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center;
}

.swbrreg-type__option input[type="radio"] { position: absolute !important; opacity: 0 !important; pointer-events: none !important; }
.swbrreg-type__option.is-selected { background: #fff !important; border-color: var(--swbrreg-border) !important; color: var(--swbrreg-ink) !important; box-shadow: 0 1px 3px rgba(15,23,42,.08) !important; }

.swbrreg-registration-panel[hidden], .swbrreg-business-panel[hidden], .swbrreg-selected[hidden], .swbrreg-field-section[hidden] { display:none!important; }

.swbrreg-registration-panel,
.swbrreg-business-panel {
    border: 0 !important;
    padding: 0 !important;
}

.swbrreg-business-panel__intro {
    display: block !important;
    margin: 0 0 14px !important;
}
.swbrreg-business-panel__intro strong { display:block; color: var(--swbrreg-soft); font-size:12.5px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; margin:0 0 6px; }
.swbrreg-business-panel__intro span { display:block; color: var(--swbrreg-muted); font-size:13.5px; line-height:1.5; }

.swbrreg-search label,
.swbrreg-managed-field label,
.swbrreg-account-fields label {
    display: block !important;
    color: var(--swbrreg-body) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 0 0 6px !important;
}

.swbrreg-search__row { display:flex!important; gap:8px!important; align-items:stretch!important; position:relative; }
.swbrreg-search__row input,
.swbrreg-managed-field input,
.swbrreg-managed-field select,
.swbrreg-account-fields input[type="text"],
.swbrreg-account-fields input[type="email"],
.swbrreg-account-fields input[type="password"] {
    width:100%!important; min-height:44px!important; height:44px!important; border:1px solid var(--swbrreg-border-strong)!important; border-radius:10px!important; background:#fff!important; color:var(--swbrreg-ink)!important; padding:0 14px!important; font-family:'Public Sans',system-ui,sans-serif!important; font-size:14px!important; box-shadow:none!important; outline:0!important;
}
.swbrreg-search__row input { padding-right:40px!important; flex:1 1 auto; min-width:0; }
.swbrreg-search__row input:focus,
.swbrreg-managed-field input:focus,
.swbrreg-managed-field select:focus,
.swbrreg-account-fields input:focus { border-color:var(--swbrreg-accent)!important; box-shadow:0 0 0 3px rgba(37,99,235,.15)!important; }
.swbrreg-search__row input::placeholder { color: #94A3B8 !important; }
.swbrreg-search__clear { position:absolute; right:82px; top:50%; transform:translateY(-50%); width:26px!important; height:26px!important; border:0!important; border-radius:7px!important; background:#F1F5F9!important; color:var(--swbrreg-muted)!important; display:flex!important; align-items:center!important; justify-content:center!important; padding:0!important; cursor:pointer!important; font-size:15px!important; line-height:1!important; }
.swbrreg-search__clear[hidden] { display:none!important; }

.swbrreg-button,
.swbrreg-box .button.swbrreg-change,
.swbrreg-box .button.swbrreg-use {
    appearance:none!important; display:inline-flex!important; align-items:center!important; justify-content:center!important; min-height:44px!important; border-radius:11px!important; border:1px solid transparent!important; cursor:pointer!important; font-family:'Public Sans',system-ui,sans-serif!important; font-size:14px!important; font-weight:700!important; line-height:1!important; padding:0 20px!important; text-decoration:none!important; white-space:nowrap!important;
}
.swbrreg-button--primary, #swbrreg_lookup_button { background:var(--swbrreg-accent)!important; border-color:var(--swbrreg-accent)!important; color:#fff!important; }
.swbrreg-button--primary:hover, .swbrreg-button--primary:focus, #swbrreg_lookup_button:hover, #swbrreg_lookup_button:focus { background:var(--swbrreg-accent-hover)!important; border-color:var(--swbrreg-accent-hover)!important; color:#fff!important; }
.swbrreg-button--secondary,
.swbrreg-box .button.swbrreg-change,
.swbrreg-box .button.swbrreg-use { background:#fff!important; border-color:var(--swbrreg-border-strong)!important; color:var(--swbrreg-accent)!important; }
.swbrreg-button--secondary:hover,.swbrreg-button--secondary:focus { background:var(--swbrreg-tag-bg)!important; border-color:var(--swbrreg-accent)!important; color:var(--swbrreg-accent)!important; }

.swbrreg-status { margin-top:12px!important; font-size:14px!important; line-height:1.45!important; }
.swbrreg-status.is-loading { display:flex; align-items:center; gap:10px; color:var(--swbrreg-body); background:#F8FAFC; border:1px solid var(--swbrreg-border); border-radius:12px; padding:12px 14px; }
.swbrreg-status.is-loading::before { content:''; width:18px; height:18px; border:2.5px solid var(--swbrreg-border-strong); border-top-color:var(--swbrreg-accent); border-radius:50%; animation:swbrreg-spin .7s linear infinite; flex:none; }
.swbrreg-status.is-error { color:var(--swbrreg-warning-text); background:var(--swbrreg-warning-bg); border:1px solid var(--swbrreg-warning-border); border-radius:12px; padding:12px 14px; }
.swbrreg-status.is-success { color:var(--swbrreg-success-text); background:var(--swbrreg-success-bg); border:1px solid var(--swbrreg-success-border); border-radius:12px; padding:12px 14px; }
@keyframes swbrreg-spin { to { transform: rotate(360deg); } }

.swbrreg-result-list { display:flex!important; flex-direction:column!important; gap:8px!important; margin-top:14px!important; max-height:300px; overflow-y:auto; overflow-x:hidden; padding-right:2px; scrollbar-gutter:stable; }
.swbrreg-result-list__count { color:var(--swbrreg-muted); margin:2px 0 2px; text-transform:none!important; letter-spacing:0!important; font-size:12.5px!important; }
.swbrreg-result { appearance:none!important; width:100%!important; display:flex!important; align-items:center!important; justify-content:space-between!important; gap:14px!important; text-align:left!important; background:#fff!important; border:1px solid var(--swbrreg-border)!important; border-radius:12px!important; padding:13px 15px!important; cursor:pointer!important; font-family:'Public Sans',system-ui,sans-serif!important; transition:border-color .12s ease, background .12s ease, box-shadow .12s ease!important; }
.swbrreg-result:hover,.swbrreg-result:focus,.swbrreg-result:focus-within { border-color:var(--swbrreg-accent)!important; background:#F8FBFF!important; box-shadow:0 0 0 3px rgba(37,99,235,.08)!important; outline:0!important; }
.swbrreg-result__main,.swbrreg-selected__content { display:grid; gap:3px; min-width:0; }
.swbrreg-result__heading,.swbrreg-selected__heading { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.swbrreg-result__heading strong,.swbrreg-selected__heading strong { color:var(--swbrreg-ink)!important; font-size:14.5px!important; line-height:1.3!important; font-weight:700!important; overflow-wrap:anywhere; }
.swbrreg-muted { display:block; color:var(--swbrreg-muted)!important; font-size:13px!important; line-height:1.35!important; }
.swbrreg-mono { font-family:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important; font-size:12.5px!important; }
.swbrreg-pill { display:inline-flex!important; align-items:center!important; width:fit-content; border-radius:999px!important; padding:1px 8px!important; font-size:11px!important; font-weight:700!important; line-height:1.55!important; background:#F1F5F9!important; border:1px solid var(--swbrreg-border)!important; color:var(--swbrreg-muted)!important; }
.swbrreg-pill--mva { color:var(--swbrreg-success-text)!important; background:var(--swbrreg-success-bg)!important; border-color:var(--swbrreg-success-border)!important; }
.swbrreg-pill--warning { color:var(--swbrreg-danger)!important; background:var(--swbrreg-danger-bg)!important; border-color:var(--swbrreg-danger-border)!important; }
.swbrreg-pills { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }

.swbrreg-selected { margin-top:14px!important; }
.swbrreg-selected__card { display:flex!important; align-items:flex-start!important; justify-content:space-between!important; gap:12px!important; background:#F0FDF4!important; border:1px solid var(--swbrreg-success-border)!important; border-radius:14px!important; padding:16px 18px!important; box-shadow:none!important; }
.swbrreg-selected__label { color:var(--swbrreg-success-text)!important; font-size:11px!important; }
.swbrreg-selected__top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.swbrreg-checkmark { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:var(--swbrreg-success); color:#fff; font-size:12px; font-weight:800; }
.swbrreg-selected__hint { display:block; color:var(--swbrreg-success-text)!important; font-size:12.5px!important; margin-top:8px!important; }

.swbrreg-registration-fields { display:grid!important; gap:26px!important; margin-top:0!important; }
.swbrreg-registration .swbrreg-field-section,
.swbrreg-account-fields { background:transparent!important; border:0!important; box-shadow:none!important; padding:0!important; }
.swbrreg-field-section__title { color:var(--swbrreg-soft)!important; margin:0 0 14px!important; }
.swbrreg-field-grid { display:grid!important; gap:14px!important; }
.swbrreg-field-grid--2 { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
.swbrreg-managed-field,
.swbrreg-account-fields p,
.swbrreg-account-fields .form-row,
.swbrreg-account-fields .woocommerce-form-row { margin:0 0 14px!important; padding:0!important; }
.swbrreg-managed-field:last-child,.swbrreg-account-fields p:last-child,.swbrreg-account-fields .form-row:last-child { margin-bottom:0!important; }
.swbrreg-managed-field.is-brreg-filled label::after { content:'Fylt fra BRREG'; display:inline-flex; margin-left:8px; padding:1px 7px; border-radius:999px; border:1px solid var(--swbrreg-tag-border); background:var(--swbrreg-tag-bg); color:var(--swbrreg-accent); font-size:10.5px; font-weight:700; letter-spacing:0; text-transform:none; vertical-align:middle; }
.swbrreg-autofill-field input[readonly] { background:#F8FAFC!important; }

@media (max-width:700px){
    .swbrreg-box__header{padding:22px 20px 18px!important}.swbrreg-registration > .swbrreg-field-section,.swbrreg-registration > .swbrreg-type-section,.swbrreg-registration > .swbrreg-registration-panel,.swbrreg-registration > .swbrreg-registration-fields,.swbrreg-box > .swbrreg-type,.swbrreg-box > .swbrreg-business-panel{margin-left:20px!important;margin-right:20px!important}.swbrreg-field-grid--2{grid-template-columns:1fr!important}.swbrreg-search__row,.swbrreg-result,.swbrreg-selected__card{display:grid!important;grid-template-columns:1fr!important}.swbrreg-button,.swbrreg-search__row .swbrreg-button,.swbrreg-result .swbrreg-button,.swbrreg-selected__card .swbrreg-button{width:100%!important}.swbrreg-search__clear{right:10px}.swbrreg-result-list{max-height:300px}
}

/* v0.1.24 — locked business-only customer type */
.swbrreg-box--business-locked .swbrreg-type--locked {
    grid-template-columns: 1fr !important;
    background: #F8FAFC !important;
    border: 1px solid var(--swbrreg-border) !important;
    padding: 6px !important;
}
.swbrreg-box--business-locked .swbrreg-type__option.is-locked,
.swbrreg-type__option.is-locked {
    cursor: not-allowed !important;
    background: #F1F5F9 !important;
    border-color: var(--swbrreg-border) !important;
    color: var(--swbrreg-body) !important;
    box-shadow: none !important;
    opacity: .9 !important;
}
.swbrreg-locked-note {
    display: block !important;
    margin: 6px 4px 2px !important;
    color: var(--swbrreg-muted) !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    text-align: center !important;
}
