/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    background-color: var(--background) !important;
    color: var(--foreground);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hidden { display: none !important; }

/* ================================================
   UTILITY CLASSES — from Beispiel
   ================================================ */
.glass-panel {
    background: rgba(23, 31, 51, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
    background: rgba(34, 42, 61, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(34, 42, 61, 0.5);
    border-color: rgba(92, 221, 168, 0.2);
    transform: translateY(-2px);
}

.luminary-glow {
    background: radial-gradient(circle at center, rgba(92, 221, 168, 0.08) 0%, transparent 70%);
}

.primary-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 100%);
}

.icon-container-premium {
    background: linear-gradient(135deg, rgba(92, 221, 168, 0.10), rgba(92, 221, 168, 0.05));
    border: 1px solid rgba(92, 221, 168, 0.20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.text-premium { letter-spacing: -0.02em; }

/* ================================================
   DOTTED SURFACE — Three.js canvas background
   ================================================ */
#prt-dottedSurface {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
#prt-dottedSurface canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* All content layers sit above the canvas */
.language-selection-screen,
#prt-mainContent,
.lang-change-bar {
    position: relative;
    z-index: 1;
}

/* ================================================
   LANGUAGE SELECTION SCREEN
   ================================================ */
.language-selection-screen {
    display: flex;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 40px !important;
    background-color: var(--background) !important;
    background-image: none !important;
    color: var(--foreground) !important;
    text-align: center !important;
    padding: 48px 24px !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
}
.language-selection-screen.hidden { display: none !important; }

.lang-screen-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Luminary glow behind logo */
.lang-screen-header::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background: radial-gradient(circle at center, rgba(92, 221, 168, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.company-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(92, 221, 168, 0.25));
}

.language-selection-screen h1 {
    font-size: 1.2em !important;
    font-weight: 900 !important;
    color: #dae2fd !important;
    margin: 0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.lang-subtitle {
    font-size: 1.1em;
    color: #dae2fd !important;
    font-weight: 500;
    margin: 0;
}
.lang-desc {
    font-size: 0.88em;
    color: #9ca7b0 !important;
    margin: 0;
}

/* Language buttons grid */
.language-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 700px;
    width: 100%;
}
@media (min-width: 600px) {
    .language-buttons { grid-template-columns: repeat(4, 1fr) !important; }
}

.language-choice-btn {
    position: relative !important;
    height: 56px !important;
    width: 100% !important;
    cursor: pointer !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 4px !important;
    background: rgba(34, 42, 61, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    outline: none !important;
    overflow: hidden !important;
    transition: border-color 0.3s ease, background 0.3s ease !important;
}
.language-choice-btn:hover {
    border-color: rgba(92, 221, 168, 0.2) !important;
    background: rgba(34, 42, 61, 0.5) !important;
}
.language-choice-btn:hover .motion-circle { width: calc(100% - 8px) !important; }
.language-choice-btn:hover .motion-text  { color: var(--background) !important; }
.language-choice-btn:hover .motion-icon  { transform: translateY(-50%) translateX(4px) !important; }

.motion-circle {
    display: block !important;
    height: 48px !important;
    width: 48px !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 100%) !important;
    transition: width 0.5s ease !important;
}
.motion-icon {
    position: absolute !important;
    top: 50% !important;
    left: 10px !important;
    transform: translateY(-50%) !important;
    transition: transform 0.5s ease !important;
    display: flex !important;
    align-items: center !important;
}
.motion-icon .flag { width: 32px !important; height: auto !important; border-radius: 3px !important; }
.flag { width: 40px !important; height: auto !important; border-radius: 3px !important; }

.motion-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin-left: 16px !important;
    white-space: nowrap !important;
    font-size: 0.95em !important;
    font-weight: 500 !important;
    color: #dae2fd !important;
    transition: color 0.5s ease !important;
    pointer-events: none !important;
}

/* ================================================
   SEARCH + LANGUAGE ROW
   ================================================ */
.search-lang-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    margin-top: 12px;
    position: relative;
    z-index: 10;
}
.search-lang-row .portal-search-wrapper {
    flex: 1;
    margin-top: 0;
    max-width: none;
}

/* Language Switcher button */
.lang-switcher {
    position: relative;
    flex-shrink: 0;
}
.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(34, 42, 61, 0.40);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    color: var(--foreground);
    transition: background 0.22s ease, border-color 0.22s ease;
}
.lang-switcher-btn:hover {
    background: rgba(34, 42, 61, 0.60);
    border-color: rgba(51, 204, 51, 0.20);
}
.current-flag { width: 22px; height: auto; border-radius: 3px; }
.lang-switcher-chevron { font-size: 0.7em; opacity: 0.6; }

/* Dropdown panel */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(23, 31, 51, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.40);
    z-index: 999;
    max-height: 360px;
    overflow-y: auto;
}

/* Each language option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--muted-foreground);
    font-family: inherit;
    font-size: 0.90em;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, color 0.18s ease;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover {
    background: rgba(92, 221, 168, 0.06);
    color: var(--foreground);
}
.lang-option img {
    width: 22px;
    height: auto;
    border-radius: 3px;
    flex-shrink: 0;
}
.lang-option span { flex: 1; }

/* Active language badge */
.lang-active-badge {
    display: none;
    font-size: 0.62em;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(92, 221, 168, 0.12);
    color: var(--primary);
    border: 1px solid rgba(92, 221, 168, 0.25);
    flex: 0 !important;
}
.lang-option.is-active {
    background: rgba(92, 221, 168, 0.06);
    color: var(--foreground);
}
.lang-option.is-active .lang-active-badge { display: inline-block; }

/* ================================================
   MAIN CONTENT
   ================================================ */
#prt-mainContent {
    min-height: 100vh;
    color: var(--foreground);
    background: var(--background) !important;
    transition: all 0.3s ease;
}

/* ================================================
   LUMINARY HEADER — hero section from Beispiel
   ================================================ */
.portal-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 56px 20px 28px;
    text-align: center;
    overflow: hidden;
}

/* No separate header glow — body mesh covers the full page uniformly */

.portal-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 14px rgba(92, 221, 168, 0.20));
}

.portal-header h1 {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--muted-foreground);
    margin: 0;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.portal-header .portal-subtitle {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--foreground);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
    position: relative;
    z-index: 1;
}

.portal-header .portal-company {
    font-size: 0.82em;
    color: var(--muted-foreground);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Search — glass-panel style from Beispiel */
.portal-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.portal-search-input {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(23, 31, 51, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--foreground);
    font-size: 0.95em;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.portal-search-input::placeholder { color: #9ca7b0; opacity: 0.5; }
.portal-search-input:focus {
    border-color: rgba(92, 221, 168, 0.30);
    box-shadow: 0 0 0 4px rgba(92, 221, 168, 0.06);
}

.portal-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1em;
    color: var(--muted-foreground);
    pointer-events: none;
    opacity: 0.5;
}

/* ================================================
   SERVICE GRID — Kategorien + Kacheln
   ================================================ */
.portal-grid {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 56px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.70em;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 14px;
    padding-left: 2px;
}
.category-icon { font-size: 1.25em; }

/* Tile grid */
.category-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 600px) {
    .category-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* Individual tile — glass-card */
.tile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    text-align: center;
    padding: 22px 12px 18px;
    background: rgba(34, 42, 61, 0.30);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--foreground);
    position: relative;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 126px;
}
.tile-item:hover {
    background: rgba(34, 42, 61, 0.52);
    border-color: rgba(92, 221, 168, 0.14);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* Large icon container */
.tile-icon {
    font-size: 1.75em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, rgba(92, 221, 168, 0.10), rgba(92, 221, 168, 0.05));
    border: 1px solid rgba(92, 221, 168, 0.18);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), inset 0 1px 1px rgba(255,255,255,0.05);
    transition: background 0.28s ease, border-color 0.28s ease;
}
.tile-item:hover .tile-icon {
    background: linear-gradient(135deg, rgba(92, 221, 168, 0.17), rgba(92, 221, 168, 0.08));
    border-color: rgba(92, 221, 168, 0.26);
}

/* Tile label */
.tile-name {
    font-size: 0.95em;
    font-weight: 100;
    color: var(--foreground);
    line-height: 1.35;
    letter-spacing: -0.01em;
    transition: color 0.22s ease;
}
.tile-item:hover .tile-name { color: rgba(92, 221, 168, 0.78); }

/* Badge tags */
.tile-tag {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 0.58em;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 9999px;
    text-transform: uppercase;
}
.tile-tag.tag-gelb { background: rgba(251,191,36,0.10); color: #fbbf24; border: 1px solid rgba(251,191,36,0.20); }
.tile-tag.tag-rot  { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.20); }

/* ================================================
   DISCLAIMER
   ================================================ */
.portal-disclaimer {
    max-width: 680px;
    margin: 0 auto 32px;
    padding: 12px 16px;
    font-size: 0.76em;
    color: var(--muted-foreground);
    text-align: center;
    opacity: 0.5;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ================================================
   PRINT
   ================================================ */
@media print {
    .language-selection-screen,
    .lang-change-bar { display: none !important; }
}
