/* Splash Screen - 50/50 blå/grøn split med slide animation */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
}

.splash-panel {
    width: 50%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-left {
    background-color: #1170F5;
}

.splash-right {
    background-color: #37C36E;
}

#splash-screen.animate .splash-left {
    transform: translateX(-100%);
}

#splash-screen.animate .splash-right {
    transform: translateX(100%);
}

#splash-screen.hidden {
    display: none;
}

/* Nybolig Font Face Definitions */
@font-face {
    font-family: 'Nybolig';
    src: url('fonts/Nybolig-Regular.woff2') format('woff2'),
         url('fonts/Nybolig-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nybolig';
    src: url('fonts/Nybolig-Medium.woff2') format('woff2'),
         url('fonts/Nybolig-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nybolig';
    src: url('fonts/Nybolig-Bold.woff2') format('woff2'),
         url('fonts/Nybolig-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nybolig';
    src: url('fonts/Nybolig-Light.woff2') format('woff2'),
         url('fonts/Nybolig-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Nybolig Color Palette */
    --nybolig-blue: #1173F5;
    --nybolig-green: #37C36E;
    --nybolig-dark-grey: #28232D;
    --nybolig-sand: #F0F0E6;
    --nybolig-white: #FFFFFF;
    --white: var(--nybolig-white);

    /* Type Accents (Design Guide) */
    --type-leader: #50465A;
    --type-event: #A5EBBE;
    --type-news: #B9DCFF;
    --type-leader-text: var(--nybolig-white);
    --type-light-text: var(--nybolig-dark-grey);

    /* Semantic Mappings */
    --primary-color: var(--nybolig-blue);
    --secondary-color: #0d5bc4; /* Darker blue for hover */
    --success-color: var(--nybolig-green);
    --danger-color: #dc3545;
    --warning-color: #ed8936;
    
    --background: var(--nybolig-sand);
    --surface: var(--nybolig-white);
    
    --text-dark: var(--nybolig-dark-grey);
    --text-light: #604A5A; /* Tertiary grey from PDF */
    --border-light: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(40, 35, 45, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(40, 35, 45, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(40, 35, 45, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Nybolig', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    overflow-y: scroll; /* Prevent layout shift */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700; /* Bold */
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

p {
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    font-weight: 400; /* Regular */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--secondary-color);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

input, textarea, select {
    display: block;
    width: 100%;
    padding: 0.75rem var(--spacing-md);
    border: 1px solid #d1d5db;
    border-radius: 0; /* Square/Sharp edges usually fit corporate/Nybolig style, but keeping slight round for modern feel */
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
    background-color: var(--surface);
    color: var(--text-dark);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(17, 115, 245, 0.1); /* Blue ring */
}

input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

input[type="tel"] {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

/* Buttons */
button {
    padding: 0.75rem var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

button:last-child {
    margin-bottom: 0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--secondary-color);
    /* No gradient, solid colors for Nybolig */
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.loading {
    opacity: 0.7;
    cursor: wait;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-logout {
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background-color: rgba(255,255,255,0.1);
}

.btn-back {
    background-color: transparent;
    color: var(--text-light);
    width: auto;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid transparent;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.btn-back:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Messages */
.error-message {
    background-color: #FEF2F2;
    color: #991B1B;
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
    border: 1px solid #FECACA;
    font-size: 0.95rem;
}

.success-message {
    background-color: #ECFDF5;
    color: #065F46;
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
    border: 1px solid #A7F3D0;
}

/* Utilities */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.text-small { font-size: 0.875rem; }
.mt-md { margin-top: var(--spacing-md); }
.mb-md { margin-bottom: var(--spacing-md); }

.debug-info {
    background-color: #FFFBEB;
    color: #92400E;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid #FDE68A;
    font-family: monospace;
    text-align: center;
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-light);
}

/* Logo helper */
.logo-container {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pure CSS Logo Implementation */
.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(90deg, var(--nybolig-blue) 50%, var(--nybolig-green) 50%);
    border-radius: 8px; /* Soft rounded corners matching the brand */
    margin-right: 12px;
    flex-shrink: 0;
}

/* Remove old img styling from logo-container if it exists, or keep for fallback */
.logo-container img {
    display: none; /* Hide the image version */
}

.brand-text {
    font-family: 'Nybolig', sans-serif;
    font-weight: 700;
    font-size: 2.25rem;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    line-height: 1;
}

/* PWA Install Screen */
#install-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.install-card {
    background-color: var(--surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border-light);
}

/* Install Instructions */
.install-instructions {
    margin: var(--spacing-lg) 0;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.ios-instructions,
.android-instructions {
    background-color: #F2F2F7; /* iOS System Gray 6 */
    padding: 20px;
    border-radius: 14px; /* iOS-like rounded corners */
    margin-top: 24px;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ios-header {
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 1rem;
    color: #000;
}

.ios-step-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-step-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #007AFF; /* iOS Blue */
    flex-shrink: 0;
}

.step-content {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
}

.ios-highlight {
    font-weight: 600;
    color: #000;
}

.ios-text-icon {
    font-weight: 600;
    font-size: 0.8rem;
    color: #007AFF;
}

.text-muted {
    color: #8E8E93; /* iOS Label Gray */
    font-size: 0.9em;
}

.skip-link {
    margin-top: var(--spacing-lg);
    color: var(--text-light);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: auto;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    z-index: 10000;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background-color: var(--nybolig-sand);
    color: var(--text-dark);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--nybolig-blue);
    max-width: 500px;
    width: calc(100% - var(--spacing-md) * 2);
    pointer-events: auto;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.toast-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-exit {
    transform: translateY(100%);
    opacity: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    color: var(--nybolig-blue);
}

.toast-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-dark);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
    margin-left: auto;
    width: auto;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-dark);
}

/* Media Queries */
@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    button { padding: 0.875rem; }
}
