@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --portal-blue: #4f9fd1;
    --portal-ink: #2d3748;
    --portal-text: #666666;
    --portal-surface: #e9e9e9;
    --portal-line: #cccccc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', system-ui, sans-serif;
    background: #FFFFFF;
    background-image: url("../assets/background_light.webp");
    background-position: center bottom;
    background-repeat: repeat;
    position: relative;
    min-height: 100vh;
}

/* Portal landing page */
.portal-home { color: var(--portal-text); background: var(--portal-surface); }
.portal-page { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 100svh; overflow: hidden; }
.portal-wrap { width: min(1320px, calc(100% - 112px)); margin-inline: auto; }
.hero-background { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-background::after { position: absolute; inset: 0; content: ''; background: linear-gradient(90deg, #e9e9e9 0%, #e9e9e9f5 24%, #e9e9e9c9 37%, #e9e9e97a 47%, #e9e9e914 62%, transparent 78%), linear-gradient(0deg, #e9e9e9 0%, #e9e9e9f2 15%, #e9e9e973 29%, transparent 48%, transparent 82%, #e9e9e969 100%); }
.world-position { position: absolute; left: 58.5%; top: 42.5%; width: min(800px, 61vw); aspect-ratio: 1; transform: translate(-45.9054%, -40.0265%); }
.world-camera { position: absolute; inset: 0; transform-origin: 45.9054% 40.0265%; animation: approach-europe 20s cubic-bezier(.32, 0, .2, 1) infinite; backface-visibility: hidden; }
.world-surface { position: absolute; inset: 0; }
.planet-texture { position: absolute; inset: -15%; opacity: 1; animation: surface-detail 20s cubic-bezier(.32, 0, .2, 1) infinite; }
.planet-texture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.map-stage { position: absolute; left: 26.51175359116022%; top: 29.529262430939227%; width: 38%; height: auto; aspect-ratio: 1448 / 1086; transform-origin: 51.03591160220995% 36.83241252302026%; opacity: .18; will-change: opacity; animation: reveal-europe 20s cubic-bezier(.32, 0, .2, 1) infinite; }
.map-stage .europe-map { display: block; width: 100%; height: 100%; object-fit: contain; backface-visibility: hidden; }
.map-light-corridors { position: absolute; inset: 0; pointer-events: none; }
.map-light-route { position: absolute; display: block; object-fit: contain; pointer-events: none; opacity: 0; will-change: opacity; animation-duration: 20s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.route-west { left: 27.900552486187845%; top: 32.13627992633518%; width: 25.62154696132597%; height: 15.930018416206263%; animation-name: corridor-west; }
.route-south { left: 48.549723756906076%; top: 33.51749539594843%; width: 15.607734806629834%; height: 23.02025782688766%; animation-name: corridor-south; }
.route-east { left: 48.549723756906076%; top: 29.926335174953962%; width: 31.767955801104975%; height: 16.206261510128915%; animation-name: corridor-east; }
@keyframes approach-europe { 0%, 2%, 100% { transform: scale(1); } 33%, 61% { transform: scale(3.35); } }
@keyframes surface-detail { 0%, 7%, 100% { opacity: 1; } 24% { opacity: .18; } 33%, 61% { opacity: .055; } 94% { opacity: 1; } }
@keyframes reveal-europe { 0%, 2%, 100% { opacity: .18; } 12% { opacity: .46; } 28%, 61% { opacity: .92; } 94% { opacity: .18; } }
@keyframes corridor-west { 0%, 20% { opacity: 0; } 30% { opacity: 1; } 39%, 60% { opacity: .38; } 77%, 100% { opacity: 0; } }
@keyframes corridor-south { 0%, 28% { opacity: 0; } 38% { opacity: 1; } 47%, 61% { opacity: .38; } 79%, 100% { opacity: 0; } }
@keyframes corridor-east { 0%, 36% { opacity: 0; } 47% { opacity: 1; } 56%, 62% { opacity: .38; } 81%, 100% { opacity: 0; } }
.site-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 33px 0 20px; gap: 24px; }
.brand { display: flex; flex-direction: column; gap: 9px; color: var(--portal-text); text-decoration: none; }
.brand img { width: 176px; height: auto; }
.brand span { font-size: .6rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; }
.language-switcher { display: flex; gap: 4px; padding: 4px; border: 1px solid #d9d9d9; border-radius: 8px; background: #ffffffc9; }
.language-switcher button { min-width: 39px; min-height: 31px; border: 0; border-radius: 5px; padding: 3px 9px; background: transparent; color: var(--portal-text); font-size: .75rem; font-weight: 600; cursor: pointer; }
.language-switcher button[aria-pressed='true'] { background: var(--portal-blue); color: #fff; }
.portal-main { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 46px; padding: 25px 0 33px; min-height: 530px; }
.hero-copy { max-width: 615px; padding-left: 26px; border-left: 1px solid #4f9fd180; }
.eyebrow { display: flex; align-items: center; gap: 11px; margin: 0 0 18px; color: var(--portal-blue); font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow::before { width: 18px; height: 1px; background: currentColor; content: ''; }
.hero-copy h1 { margin: 0 0 23px; color: var(--portal-ink); font-size: clamp(2.75rem, 4.1vw, 3.85rem); font-weight: 700; line-height: 1.13; letter-spacing: -.025em; }
.accent { color: var(--portal-blue); }.hero-description { max-width: 475px; margin: 0; font-size: 1.04rem; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 29px; }
.button { display: inline-flex; min-height: 53px; align-items: center; justify-content: center; gap: 25px; border: 1px solid transparent; border-radius: 8px; padding: 13px 24px; font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .2s ease, background-color .2s ease; }
.button:hover { transform: translateY(-2px); }.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.button-primary { border-color: var(--portal-blue); background: var(--portal-blue); color: #fff; }.button-primary:hover { background: #97d1f0; }
.button-secondary { border-color: var(--portal-line); background: #ffffffc2; color: var(--portal-ink); }.button-secondary:hover { border-color: var(--portal-blue); background: #fff; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--portal-line); padding: 21px 0 17px; }
.feature-item { position: relative; min-width: 0; padding: 3px 26px 4px; }.feature-item:first-child { padding-left: 0; }.feature-item:last-child { padding-right: 0; }.feature-item + .feature-item { border-left: 1px solid #ccccccaa; }
.page-reveal { animation: page-reveal .75s cubic-bezier(.22, .8, .28, 1) both; }.hero-copy.page-reveal { animation-delay: .08s; }.feature-item:nth-child(1).page-reveal { animation-delay: .22s; }.feature-item:nth-child(2).page-reveal { animation-delay: .32s; }.feature-item:nth-child(3).page-reveal { animation-delay: .42s; }.feature-item:nth-child(4).page-reveal { animation-delay: .52s; }
@keyframes page-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.feature-item::after { position: absolute; top: 4px; right: 22px; color: #888; content: attr(data-index); font-size: .72rem; }.feature-item:last-child::after { right: 0; }
.feature-title { display: flex; align-items: center; gap: 10px; padding-right: 24px; margin-bottom: 10px; color: #454545; }.feature-title h2 { margin: 0; font-size: .9rem; font-weight: 500; line-height: 1.4; }
.feature-icon { width: 17px; height: 17px; flex: 0 0 17px; color: var(--portal-blue); }.feature-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-fleet { color: #e99c1c; }.icon-dispatch { color: #d95b5b; }.icon-crew { color: #519d79; }.feature-item p { max-width: 245px; margin: 0; font-size: .875rem; line-height: 1.75; }
.feature-item:nth-child(2) { padding-right: 0; }.feature-item:nth-child(2) p { max-width: 270px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid #cccccc73; padding: 18px 0 28px; font-size: .73rem; }.site-footer a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }.site-footer a:hover { color: var(--portal-blue); }.site-footer svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; }.site-footer strong { color: #454545; font-weight: 600; }.footer-meta { display: flex; align-items: center; gap: 18px; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 2; padding: 10px; background: var(--portal-blue); color: #fff; }.skip-link:focus { top: 10px; }
.contact-dialog { width: min(530px, calc(100% - 36px)); max-height: calc(100dvh - 36px); border: 1px solid var(--portal-blue); border-radius: 19px; padding: 35px; color: var(--portal-text); background: #fff; box-shadow: 0 30px 110px #2d374829; }.contact-dialog::backdrop { background: #2d37485c; backdrop-filter: blur(8px); }
.dialog-heading { position: relative; padding-right: 28px; }.dialog-heading .eyebrow { margin-bottom: 12px; }.dialog-heading h2 { margin: 0; color: #454545; font-size: 1.9rem; font-weight: 500; line-height: 1.2; }.dialog-heading > p:last-of-type { margin: 13px 0 0; font-size: .9rem; line-height: 1.7; }.dialog-close { position: absolute; top: -12px; right: -9px; width: 36px; height: 36px; border: 0; border-radius: 7px; background: transparent; color: var(--portal-text); font-size: 1.6rem; cursor: pointer; }.dialog-close:hover { background: #f5f5f5; }
.contact-form { display: grid; gap: 17px; margin-top: 25px; }.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.contact-form label { display: grid; gap: 7px; color: #454545; font-size: .875rem; }.contact-form label small { color: var(--portal-text); font-size: .75rem; }.contact-form input, .contact-form textarea { width: 100%; border: 1px solid #d9d9d9; border-radius: 7px; padding: 10px 12px; background: #f5f5f5; color: var(--portal-ink); font: inherit; }.contact-form input { min-height: 46px; }.contact-form textarea { min-height: 108px; resize: vertical; }.turnstile-widget { width: 100%; min-height: 65px; }.contact-form .button { width: 100%; justify-content: space-between; }.contact-form .button:disabled { cursor: not-allowed; opacity: .55; transform: none; }.form-status { min-height: 1.3em; margin: 0; font-size: .875rem; }
@media (max-width: 820px) { .portal-wrap { width: calc(100% - 48px); }.hero-background { display: none; }.portal-main { min-height: 0; padding: 40px 0; }.features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }.feature-item { padding: 0; }.feature-item + .feature-item { border-left: 0; }.feature-item::after { right: 0; } }
@media (max-width: 460px) { .portal-wrap { width: calc(100% - 40px); }.site-header { padding-top: 26px; }.brand img { width: 135px; }.brand span { font-size: .5rem; }.hero-copy { padding-left: 0; border-left: 0; }.hero-copy h1 { font-size: 2.55rem; }.hero-description { font-size: .95rem; }.button { min-height: 49px; padding: 12px 15px; gap: 12px; }.features { grid-template-columns: 1fr; gap: 20px; }.feature-item { padding-top: 10px; border-top: 1px solid #ccccccaa; }.site-footer { flex-wrap: wrap; padding-bottom: 22px; }.contact-dialog { padding: 25px 21px; }.form-row { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .page-reveal { animation: none; opacity: 1; transform: none; }.world-camera { animation: none; transform: scale(3.35); }.planet-texture { animation: none; opacity: .055; }.map-stage { animation: none; opacity: .92; }.map-light-route { animation: none; opacity: .65; }.button { transition: none; } }

/* ── keycloak split backgrounds ── */
.kc-blue-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    min-height: 50vh;
    background-color: #4F9FD1;
    background-image: linear-gradient(rgba(79, 159, 209, 0.85), rgba(79, 159, 209, 0.85)), url("../assets/train.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* ── railway route animation ── */
.route-dash {
    stroke-dasharray: 10 6;
    animation: flowDash 18s linear infinite;
}

@keyframes flowDash {
    to { stroke-dashoffset: -320; }
}

/* pulse rings on station dots */
.station-pulse {
    animation: stationPulse 3s ease-in-out infinite;
}

@keyframes stationPulse {
    0%, 100% { opacity: .6; r: 5; }
    50%       { opacity: 1;  r: 7; }
}

/* ── login button ── */
.btn-login {
    background: #4F9FD1;
    transition: background-color .3s ease, transform .3s ease, box-shadow .3s ease;
}

.btn-login:hover:not(:disabled) {
    background: #64a9d4;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(79, 159, 209, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ── input focus ring ── */
.login-input:focus {
    outline: none;
    border-color: #4F9FD1;
    box-shadow: 0 0 0 3px rgba(79, 159, 209, .2);
}

.login-input.error {
    border-color: #FC8181;
    box-shadow: 0 0 0 3px rgba(252, 129, 129, .2);
}

/* ── spinner ── */
.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── feature item hover ── */
.feature-item {
    transition: transform .18s;
}

.feature-item:hover {
    transform: translateX(5px);
}

/* ── background gradient ── */
.panel-dark {
    background: linear-gradient(155deg, #0b2d45 0%, #1a5a8a 55%, #1e6e9e 100%);
}

/* ── subtle grid overlay on dark panel ── */
.panel-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ── fade-in for the login card ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
    animation: fadeUp .5s ease both;
}

/* ── shake on error ── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60%  { transform: translateX(-6px); }
    40%, 80%  { transform: translateX(6px); }
}

.shake {
    animation: shake .35s ease;
}

/* ── keycloak language dropdown alignment ── */
#kc-locale-dropdown {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  padding: 0.5rem 1.5rem 0.5rem 1rem !important; /* added small right padding adjustment */
  font-size: 0.875rem !important;
  border: 1px solid #CCCCCC !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  color: #000000 !important;
  cursor: pointer !important;
  width: auto !important;
  line-height: normal !important;
}

#kc-locale-dropdown:hover {
  border-color: #4F9FD1 !important;
}

#kc-locale-dropdown:focus {
  outline: none !important;
  border-color: #4F9FD1 !important;
  box-shadow: 0 0 0 0.1875rem rgba(79, 159, 209, 0.1) !important;
}
