/* HIB Frivilligportal - Premium Mobile-First Styling */

:root {
    --hib-primary: #2563eb;
    --hib-primary-hover: #1d4ed8;
    --hib-secondary: #f1f5f9;
    --hib-secondary-hover: #e2e8f0;
    --hib-text-main: #1e293b;
    --hib-text-muted: #64748b;
    --hib-bg: #ffffff;
    --hib-border: #e2e8f0;
    --hib-success: #10b981;
    --hib-error: #ef4444;
    --hib-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --hib-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hib-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hib-radius: 12px;
    --hib-max-width: 600px;
    --hib-font: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
    --hib-shadow: var(--hib-shadow-lg);
    --hib-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --hib-bg-alt: #fafafa;
    --hib-border-hover: #cbd5e1;
    --hib-card-bg: #ffffff;
    --hib-checked-bg: #eff6ff;
    --hib-pill-bg: #f8fafc;
}

.hib-frivillig-wrapper[data-theme="dark"] {
    --hib-primary: #3b82f6;
    --hib-primary-hover: #60a5fa;
    --hib-bg: #1e293b;
    --hib-bg-alt: #0f172a;
    --hib-card-bg: #334155;
    --hib-text-main: #f8fafc;
    --hib-text-muted: #94a3b8;
    --hib-secondary: #334155;
    --hib-secondary-hover: #475569;
    --hib-border: #475569;
    --hib-border-hover: #64748b;
    --hib-checked-bg: rgba(59, 130, 246, 0.15);
    --hib-pill-bg: #1e293b;
}

.hib-frivillig-wrapper[data-theme="custom"] {
    /* Custom colors injects bg, text-main, primary. We calculate variants for rest: */
    --hib-bg-alt: color-mix(in srgb, var(--hib-bg) 95%, black);
    --hib-card-bg: var(--hib-bg);
    --hib-border: color-mix(in srgb, var(--hib-bg) 85%, black);
    --hib-border-hover: color-mix(in srgb, var(--hib-bg) 75%, black);
    --hib-secondary: color-mix(in srgb, var(--hib-bg) 90%, black);
    --hib-secondary-hover: color-mix(in srgb, var(--hib-bg) 80%, black);
    --hib-text-muted: color-mix(in srgb, var(--hib-text-main) 65%, transparent);
    --hib-checked-bg: color-mix(in srgb, var(--hib-primary) 10%, transparent);
    --hib-pill-bg: color-mix(in srgb, var(--hib-bg) 95%, black);
}

.hib-frivillig-wrapper {
    max-width: var(--hib-max-width, 600px);
    margin: 2rem auto;
    font-family: var(--hib-font, 'Inter', 'Outfit', system-ui, -apple-system, sans-serif);
    color: var(--hib-text-main);
    box-sizing: border-box;
}

.hib-frivillig-wrapper * {
    box-sizing: inherit;
}

.hib-wizard {
    background: var(--hib-bg);
    border-radius: var(--hib-radius, 12px);
    padding: 24px;
    box-shadow: var(--hib-shadow, var(--hib-shadow-lg));
    border: 1px solid var(--hib-border);
    /* Subtle glassmorphism effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--hib-bg);
}

/* Progress Bar */
.hib-progress-container {
    position: relative;
    margin-bottom: 30px;
    height: 4px;
    background: var(--hib-secondary);
    border-radius: 4px;
}

.hib-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--hib-primary);
    border-radius: 4px;
    width: 25%;
    transition: width 0.4s ease-in-out;
}

.hib-step-indicator {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: -6px;
    left: 0;
    width: 100%;
}

.step-dot {
    width: 16px;
    height: 16px;
    background: var(--hib-secondary);
    border-radius: 50%;
    border: 2px solid var(--hib-bg);
    transition: var(--hib-transition);
}

.step-dot.active {
    background: var(--hib-primary);
    box-shadow: var(--hib-primary-glow, 0 0 0 3px rgba(37, 99, 235, 0.2));
}

/* Steps */
.hib-step {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.hib-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hib-step h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--hib-text-main);
}

.hib-subtitle {
    font-size: 0.95rem;
    color: var(--hib-text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Form Elements */
.hib-form-group {
    margin-bottom: 20px;
}

.hib-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--hib-text-main);
}

.hib-form-group input[type="text"],
.hib-form-group input[type="email"],
.hib-form-group input[type="tel"],
.hib-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--hib-border);
    border-radius: min(var(--hib-radius, 12px), 8px);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--hib-transition);
    background: var(--hib-bg-alt);
    color: var(--hib-text-main);
}

.hib-form-group input:focus,
.hib-form-group textarea:focus {
    outline: none;
    border-color: var(--hib-primary);
    background: var(--hib-card-bg);
    box-shadow: var(--hib-primary-glow-sm, 0 0 0 3px rgba(37, 99, 235, 0.1));
}

/* Elegant Option Cards (Replaces checkboxes) */
.hib-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.hib-option-card {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 16px 20px;
    border: 1.5px solid var(--hib-border);
    border-radius: var(--hib-radius, 12px);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--hib-card-bg);
    text-align: left;
    overflow: hidden;
    gap: 18px !important; /* Økt avstand mellom checkbox og tekst */
}

.hib-option-card input {
    display: none;
}

/* Custom Checkbox Indicator */
.hib-option-checkbox-indicator {
    width: 20px;
    height: 20px;
    border-radius: min(var(--hib-radius, 12px), 6px);
    border: 2px solid var(--hib-border-hover);
    background: var(--hib-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.hib-option-card:hover .hib-option-checkbox-indicator {
    border-color: var(--hib-primary);
}

.hib-option-card:has(input:checked) .hib-option-checkbox-indicator {
    background: var(--hib-primary);
    border-color: var(--hib-primary);
    color: #ffffff;
}

/* Content Layout */
.hib-option-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.hib-option-title {
    font-size: 0.95rem; /* Litt mindre tekst */
    font-weight: 600;
    color: var(--hib-text-main);
    transition: color 0.2s ease;
    line-height: 1.4;
}

.hib-option-subtitle {
    font-size: 0.8rem; /* Litt mindre undertittel */
    color: var(--hib-text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.hib-option-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.hib-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.hib-day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hib-time-info {
    font-size: 0.78rem;
    color: var(--hib-text-muted);
}

.hib-shifts-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 2px 2px 8px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hib-shifts-filter-bar::-webkit-scrollbar {
    display: none;
}

.hib-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: min(var(--hib-radius, 12px), 20px);
    border: 1.5px solid var(--hib-border);
    background: var(--hib-card-bg);
    color: var(--hib-text-muted);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
}

.hib-filter-btn:hover {
    border-color: var(--hib-primary);
    color: var(--hib-text-main);
    background: var(--hib-bg-alt);
    transform: translateY(-1px);
}

.hib-filter-btn.is-active {
    border-color: var(--hib-primary);
    background: var(--hib-primary);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.hib-filter-btn.is-active .hib-day-dot {
    background: #ffffff !important;
}

.hib-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
    font-weight: 600;
}

.hib-filter-btn.is-active .hib-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.hib-option-card.is-filtered-out {
    display: none !important;
}

.hib-frivillig-wrapper[data-theme="dark"] .hib-day-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

.hib-option-badge-wrapper {
    margin-top: 6px;
}

/* Checked state card */
.hib-option-card:has(input:checked) {
    border-color: var(--hib-primary);
    background: var(--hib-checked-bg);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.hib-option-card:has(input:checked) .hib-option-title {
    color: var(--hib-primary);
}

/* Hover state card */
.hib-option-card:hover {
    border-color: var(--hib-primary);
    transform: translateY(-2px);
    box-shadow: var(--hib-shadow-md);
}


/* Organisasjon Pills */
.hib-org-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hib-org-pill {
    background: var(--hib-secondary);
    color: var(--hib-text-main);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.hib-org-pill:hover {
    background: var(--hib-secondary-hover);
    border-color: var(--hib-border-hover);
    transform: scale(1.02);
}

/* Kontonummer for egen organisasjon */
#hib-account-number-group {
    background: rgba(var(--hib-primary-rgb, 14, 116, 144), 0.04);
    border: 1.5px solid rgba(var(--hib-primary-rgb, 14, 116, 144), 0.2);
    padding: 16px 18px;
    border-radius: var(--hib-radius, 12px);
    transition: all 0.3s ease;
}

.hib-account-suggestion-btn:hover {
    background: #d1fae5 !important;
    border-color: #34d399 !important;
    transform: translateY(-1px);
}

/* Kontonummer konfliktløser */
.hib-account-conflict-card {
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
    animation: hibFadeIn 0.3s ease-out;
}

.hib-account-conflict-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.hib-account-conflict-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.hib-account-conflict-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #92400e;
}

.hib-account-conflict-text {
    font-size: 0.85rem;
    color: #78350f;
    line-height: 1.45;
    margin: 4px 0 10px 0;
}

.hib-account-conflict-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hib-conflict-btn-accept {
    cursor: pointer;
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.25);
}

.hib-conflict-btn-accept:hover {
    background: #059669;
    transform: translateY(-1px);
}

.hib-conflict-btn-cancel {
    cursor: pointer;
    background: transparent;
    color: #92400e;
    border: 1px solid #d97706;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s;
}

.hib-conflict-btn-cancel:hover {
    background: rgba(217, 119, 6, 0.1);
}

.hib-account-conflict-resolved {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    color: #065f46;
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: hibFadeIn 0.3s ease-out;
}

.hib-account-conflict-blocked {
    background: #fef2f2;
    border: 1.5px solid #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    color: #991b1b;
    font-size: 0.85rem;
    line-height: 1.45;
    animation: hibFadeIn 0.3s ease-out;
}

/* Frontend Shift Time Conflict Highlights & Notice */
.hib-option-card.hib-card-has-conflict,
.hib-option-card.hib-card-has-conflict:has(input:checked) {
    border-color: #f97316 !important;
    background: #fffbf5 !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35) !important;
}

.hib-option-card.hib-card-has-conflict:hover {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.45) !important;
}

.hib-conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.hib-conflict-notice-box {
    background: #fff7ed;
    border: 1.5px solid #f97316;
    border-radius: var(--hib-radius, 12px);
    padding: 16px 18px;
    animation: hibFadeIn 0.3s ease-out;
}

.hib-conflict-notice-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hib-conflict-notice-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.hib-conflict-notice-content strong {
    display: block;
    font-size: 0.95rem;
    color: #9a3412;
    margin-bottom: 4px;
    font-weight: 700;
}

.hib-conflict-notice-content p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #9a3412;
}

@keyframes hibFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.hib-wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    gap: 12px;
}

.hib-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--hib-radius, 12px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hib-transition);
    text-align: center;
    font-family: inherit;
}

.hib-btn-secondary {
    background: var(--hib-secondary);
    color: var(--hib-text-main);
}

.hib-btn-secondary:hover {
    background: var(--hib-secondary-hover);
}

.hib-next,
.hib-submit {
    background: var(--hib-primary);
    color: #fff;
    box-shadow: var(--hib-btn-sm-shadow, 0 4px 14px rgba(37, 99, 235, 0.25));
}

.hib-next:hover,
.hib-submit:hover {
    background: var(--hib-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--hib-btn-sm-shadow-hover, 0 6px 18px rgba(37, 99, 235, 0.35));
}

/* Success Step */
.hib-step-success {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-out forwards;
}

.hib-success-icon {
    width: 64px;
    height: 64px;
    background: var(--hib-success);
    color: white;
    font-size: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.2);
}

.hib-step-success h2 {
    font-size: 1.75rem;
    color: var(--hib-text-main);
    margin-bottom: 12px;
}

.hib-step-success p {
    color: var(--hib-text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Validation styling */
.hib-error-msg {
    color: var(--hib-error);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease-out;
}
.hib-error-msg svg {
    flex-shrink: 0;
}
.hib-input-error {
    border-color: var(--hib-error) !important;
    background: color-mix(in srgb, var(--hib-error) 10%, var(--hib-bg-alt)) !important;
}
.hib-grid-error .hib-option-card {
    border-color: color-mix(in srgb, var(--hib-error) 40%, var(--hib-card-bg));
    background: color-mix(in srgb, var(--hib-error) 10%, var(--hib-card-bg));
}
.hib-grid-error .hib-option-card:hover {
    border-color: var(--hib-error);
}

/* Loader */
.hib-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .hib-wizard {
        padding: 20px 16px;
        border-radius: var(--hib-radius, 12px);
    }
    
    .hib-step h2 {
        font-size: 1.35rem;
    }
    
    .hib-wizard-actions {
        flex-direction: column-reverse;
    }
    
    .hib-btn {
        width: 100%;
    }
}

/* =========================================
   INTRO VIEW (Forside SPA)
========================================= */
.hib-intro,
.hib-event-info-view {
    background: var(--hib-bg);
    border-radius: var(--hib-radius, 12px);
    padding: 24px;
    box-shadow: var(--hib-shadow, var(--hib-shadow-lg));
    border: 1px solid var(--hib-border);
    animation: fadeIn 0.4s ease-out forwards;
}
.hib-intro-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: var(--hib-radius, 12px);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.hib-intro-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 350px;
}
.hib-intro-content {
    max-width: 600px;
    margin: 0 auto;
}
.hib-intro-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--hib-text-main);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.hib-intro-text {
    font-size: 1.1rem;
    color: var(--hib-text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
}
.hib-intro-select-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hib-text-main);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--hib-bg);
    padding-bottom: 10px;
}
.hib-event-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 30px;
}
.hib-event-card-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--hib-card-bg);
    border: 2px solid var(--hib-border);
    padding: 20px 25px;
    border-radius: var(--hib-radius, 12px);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.hib-event-card-btn:hover {
    border-color: var(--hib-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.1);
}
.hib-event-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hib-text-main);
}
.hib-event-card-arrow {
    font-size: 1.5rem;
    color: var(--hib-primary);
    font-weight: bold;
    transition: transform 0.2s ease;
}
.hib-event-card-btn:hover .hib-event-card-arrow {
    transform: translateX(5px);
}

/* =========================================
   KAPASITET & RESERVELISTE
========================================= */
.hib-option-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.hib-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: fadeIn 0.3s ease-out;
}
.hib-pill-green {
    background-color: #dcfce7;
    color: #166534;
}
.hib-pill-orange {
    background-color: #fef9c3;
    color: #854d0e;
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.4);
}
.hib-pill-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.hib-shift-full {
    background: var(--hib-pill-bg);
    border-color: var(--hib-border);
}
.hib-shift-full .hib-option-title {
    color: var(--hib-text-muted);
}
.hib-shift-full:hover {
    border-color: var(--hib-border-hover);
    transform: none;
    box-shadow: none;
}
.hib-shift-full:has(input:checked) {
    border-color: var(--hib-error);
    background: rgba(239, 68, 68, 0.08);
    transform: none;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}
.hib-shift-full:has(input:checked) .hib-option-checkbox-indicator {
    background: var(--hib-error);
    border-color: var(--hib-error);
    color: #ffffff;
}
.hib-shift-full:has(input:checked) .hib-option-title {
    color: var(--hib-error);
}

/* =========================================
   TREKKSPILL (ACCORDION) FOR GRUPPER
========================================= */
.hib-accordion-group {
    border: 1px solid var(--hib-border);
    border-radius: var(--hib-radius, 12px);
    margin-bottom: 12px;
    background: var(--hib-card-bg);
    overflow: hidden;
    transition: all 0.2s ease;
}
.hib-accordion-group:hover {
    border-color: var(--hib-border-hover);
}
.hib-accordion-group.has-selection {
    border-color: var(--hib-primary);
    box-shadow: 0 0 0 1px var(--hib-primary);
}

.hib-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    background: var(--hib-pill-bg);
    user-select: none;
    transition: background 0.2s ease;
}
.hib-accordion-header:hover {
    background: var(--hib-secondary);
}

.hib-accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--hib-text-main);
}

.hib-accordion-check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--hib-border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
}
.hib-accordion-group.has-selection .hib-accordion-check {
    background: var(--hib-primary);
    border-color: var(--hib-primary);
    color: #fff;
}

.hib-accordion-icon {
    color: var(--hib-text-muted);
    transition: transform 0.3s ease;
}
.hib-accordion-group.active .hib-accordion-icon {
    transform: rotate(180deg);
}

.hib-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: var(--hib-card-bg);
}
.hib-accordion-group.active .hib-accordion-content {
    max-height: 2000px;
}

.hib-options-grid-nested {
    padding: 16px 20px 24px 20px;
    gap: 12px;
}
.hib-options-grid-nested .hib-option-card {
    padding: 16px; /* Litt nettere kort inni gruppene */
}

/* =========================================
   INFO VIEW (Arrangementbeskrivelse)
========================================= */
.hib-info-card {
    background: var(--hib-card-bg);
    border-radius: var(--hib-radius, 12px);
    padding: 40px;
    box-shadow: var(--hib-shadow, var(--hib-shadow-lg));
    border: 1px solid var(--hib-border);
    animation: fadeIn 0.4s ease-out;
}
@media (max-width: 640px) {
    .hib-info-card {
        padding: 24px;
    }
}
.hib-frivillig-wrapper .hib-info-main-title {
    color: var(--hib-text-main);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 0;
}
.hib-info-content-area {
    color: var(--hib-text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}
.hib-frivillig-wrapper .hib-info-content-area h1,
.hib-frivillig-wrapper .hib-info-content-area h2,
.hib-frivillig-wrapper .hib-info-content-area h3 {
    color: var(--hib-text-main);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 700;
}
.hib-frivillig-wrapper .hib-info-content-area p {
    color: var(--hib-text-muted);
    margin-bottom: 1em;
}
.hib-info-content-area ul,
.hib-info-content-area ol {
    margin-bottom: 1.5em;
    padding-left: 20px;
}
.hib-frivillig-wrapper .hib-info-content-area li {
    color: var(--hib-text-muted);
    margin-bottom: 0.5em;
}
.hib-info-content-area a {
    color: var(--hib-primary);
    text-decoration: underline;
}

/* CTA Button on Info View */
.hib-btn-cta {
    position: relative;
    z-index: 5;
    background: var(--hib-primary, #2563eb);
    background: linear-gradient(135deg, var(--hib-primary-light, #3b82f6) 0%, var(--hib-primary, #2563eb) 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 18px 30px;
    border-radius: var(--hib-radius, 12px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-shadow: var(--hib-btn-shadow, 0 10px 25px rgba(37, 99, 235, 0.35));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hib-btn-cta svg {
    transition: transform 0.3s ease;
}
.hib-btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--hib-btn-shadow-hover, 0 14px 32px rgba(37, 99, 235, 0.45));
    background: linear-gradient(135deg, var(--hib-primary, #2563eb) 0%, var(--hib-primary-hover, #1d4ed8) 100%);
}
.hib-btn-cta:hover svg {
    transform: translateX(4px);
}
.hib-btn-cta:active {
    transform: translateY(1px);
    box-shadow: var(--hib-btn-shadow-active, 0 4px 12px rgba(37, 99, 235, 0.3));
}

/* Back Buttons */
.hib-back-btn {
    background: var(--hib-secondary);
    border: none;
    color: var(--hib-text-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 30px;
    transition: all 0.2s ease;
}
.hib-back-btn:hover {
    background: var(--hib-secondary-hover);
    transform: translateX(-4px);
}

/* Event Info Header & Logo */
.hib-event-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.hib-event-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 140px;
    max-height: 70px;
    flex-shrink: 0;
}

.hib-event-logo-img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

@media (max-width: 600px) {
    .hib-event-logo-wrap {
        max-width: 100px;
        max-height: 50px;
    }
    .hib-event-logo-img {
        max-height: 44px;
    }
}

/* =========================================
   TRENN 4: OPPSUMMERING SKJERM
   ========================================= */
.hib-summary-card {
    background: var(--hib-bg-alt);
    border: 1px solid var(--hib-border);
    border-radius: var(--hib-radius);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--hib-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.hib-summary-section {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hib-border);
}

.hib-summary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hib-summary-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hib-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.hib-summary-value {
    font-size: 0.95rem;
    color: var(--hib-text-main);
    line-height: 1.6;
}

.hib-summary-value strong {
    color: var(--hib-text-main);
    font-weight: 600;
}

/* =========================================
   STENGT PÅMELDING (CLOSED REGISTRATION NOTICE)
   ========================================= */
.hib-closed-message-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--hib-radius);
    background: var(--hib-bg-alt);
    border: 1.5px solid var(--hib-border);
    margin: 20px 0;
    box-shadow: var(--hib-shadow-sm);
    text-align: left;
}

.hib-closed-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hib-primary);
    background: var(--hib-checked-bg);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.hib-closed-message-container h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--hib-text-main);
}

.hib-closed-message-container p {
    font-size: 0.95rem;
    color: var(--hib-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Specific styling for the intro-mode closed banner */
#hib-info-closed-message.hib-closed-message-container {
    margin: 30px 0 0 0;
    border-color: var(--hib-border);
}

/* =========================================
   EVENT GALLERY (Arrangement Bildegalleri)
   ========================================= */
.hib-event-gallery {
    margin-top: 36px;
    width: 100%;
    position: relative;
    animation: fadeIn 0.4s ease-out;
}

.hib-gallery-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    max-height: 440px;
    border-radius: var(--hib-radius, 14px);
    overflow: hidden;
    background: var(--hib-bg-alt, #0f172a);
    box-shadow: var(--hib-shadow, 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));
    border: 1px solid var(--hib-border, #e2e8f0);
    transition: aspect-ratio 0.45s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1), min-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stående / Vertikalt format (4:5) */
.hib-gallery-viewport.is-vertical,
.hib-gallery-viewport[data-layout="vertical"],
.hib-gallery-viewport[data-orientation="vertical"] {
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 4 / 5;
    min-height: 380px;
    max-height: 560px;
}

.hib-gallery-slides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hib-gallery-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hib-gallery-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hib-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.hib-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    padding: 36px 20px 16px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 2;
}

.hib-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--hib-text-main, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
    padding: 0;
}

.hib-gallery-nav:hover {
    opacity: 1;
    background: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.hib-gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.hib-gallery-prev {
    left: 14px;
}

.hib-gallery-next {
    right: 14px;
}

.hib-gallery-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.hib-gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--hib-border, #cbd5e1);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hib-gallery-dot:hover:not(.active) {
    background: var(--hib-text-muted, #94a3b8);
    transform: scale(1.2);
}

.hib-gallery-dot.active {
    background: var(--hib-primary, #0284c7);
    width: 24px;
    border-radius: 4px;
}

/* Dark theme overrides for gallery */
[data-theme="dark"] .hib-gallery-nav {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hib-gallery-nav:hover {
    background: rgba(51, 65, 85, 0.95);
}

[data-theme="dark"] .hib-gallery-dot {
    background: #475569;
}

@media (max-width: 480px) {
    .hib-event-gallery {
        margin-top: 28px;
    }
    .hib-gallery-nav {
        width: 34px;
        height: 34px;
    }
    .hib-gallery-prev {
        left: 8px;
    }
    .hib-gallery-next {
        right: 8px;
    }
    .hib-gallery-caption {
        font-size: 0.85rem;
        padding: 24px 12px 12px 12px;
    }
}



/* A closed day stays visible, including its schedule and existing availability. */
.hib-option-card.hib-shift-closed { opacity: .7; cursor: not-allowed; }
.hib-option-card.hib-shift-closed:hover { transform: none; box-shadow: none; }

.hib-closed-event-list { margin-block-start: 20px; }
.hib-closed-event-list > summary { cursor: pointer; padding-block: 12px; font-weight: 600; }
.hib-closed-event-list > .hib-event-cards { margin-block-start: 8px; }
.hib-event-reserve-label:not([hidden]) { display: block; margin-block-start: 4px; font-size: .8em; }
