:root {
    color-scheme: light dark;
    --page-bg: #edf3f5;
    --page-overlay: rgba(244, 248, 249, 0.42);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-muted: rgba(237, 244, 246, 0.88);
    --text: #172326;
    --text-muted: #55676b;
    --line: rgba(28, 67, 72, 0.16);
    --primary: #187c4c;
    --primary-hover: #12663e;
    --primary-soft: rgba(24, 124, 76, 0.11);
    --shadow: 0 24px 70px rgba(23, 52, 57, 0.16);
    --background-image: url('/Resources/Images/welcome-ppe-light.webp');
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--page-bg); }

body {
    display: block;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background-color: var(--page-bg);
    background-image: linear-gradient(var(--page-overlay), var(--page-overlay)), var(--background-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    background: radial-gradient(circle at 50% 18%, rgba(255,255,255,.5), transparent 37%), linear-gradient(180deg, transparent 70%, rgba(16,53,57,.08));
}

.page-shell {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(28px, 6vh, 72px) 0 28px;
}

.glass-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.welcome-container {
    position: relative;
    overflow: hidden;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(26px, 5vw, 52px);
    border-radius: 28px;
    text-align: left;
    animation: panel-enter 480ms cubic-bezier(.2,.8,.2,1) both;
}

.welcome-container::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    content: "";
    background: linear-gradient(180deg, var(--primary), rgba(24,124,76,.18));
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.brand-row .logo {
    display: block;
    width: min(330px, 62vw);
    max-height: 116px;
    object-fit: contain;
    object-position: left center;
}

.server-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.server-badge::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    content: "";
    background: #32ad68;
    box-shadow: 0 0 0 5px rgba(50,173,104,.12);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.welcome-container h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 750;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.lead-copy {
    max-width: 580px;
    margin: 16px 0 30px;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.14rem);
    line-height: 1.6;
}

.action-list { display: grid; gap: 12px; }
.action-list form { margin: 0; }

.action-list .btn {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: 0 !important;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 650;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.action-list .btn i { width: 28px; margin-right: 12px; font-size: 1.25rem; text-align: center; }

.action-list .btn-primary {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 24px rgba(24,124,76,.22);
}

.action-list .btn-outline-secondary {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface-muted);
}

.action-list .btn:hover, .action-list .btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(18,48,52,.15);
}

.action-list .btn-primary:hover, .action-list .btn-primary:focus-visible { border-color: var(--primary-hover); background: var(--primary-hover); }
.action-list .btn-outline-secondary:hover, .action-list .btn-outline-secondary:focus-visible { border-color: rgba(24,124,76,.38); color: var(--primary); background: var(--primary-soft); }

.footer {
    max-width: 900px;
    margin: 22px auto 0;
    padding: 24px 28px 18px;
    border-radius: 22px;
    font-size: .92rem;
    animation: panel-enter 560ms 70ms cubic-bezier(.2,.8,.2,1) both;
}

.footer-main { display: grid; grid-template-columns: minmax(220px,1.2fr) minmax(180px,.8fr) auto; align-items: center; gap: 28px; }
.footer-brand .logo { width: 190px; max-width: 100%; max-height: 74px; margin: 0 0 10px; object-fit: contain; object-position: left center; }
.footer p, .footer ul { margin-bottom: 0; }
.footer-copy, .footer a, .contact-list { color: var(--text-muted); }
.footer a:hover, .footer a:focus-visible { color: var(--primary); text-decoration: none; }
.contact-list li + li { margin-top: 6px; }
.contact-list i { width: 22px; color: var(--primary); }
.social-block { text-align: right; }
.social-icons { display: flex; justify-content: flex-end; gap: 10px; }

.social-icons a {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text-muted);
    background: var(--surface-muted);
    transition: transform 160ms ease, color 160ms ease, border-color 160ms ease;
}

.social-icons a:hover, .social-icons a:focus-visible { transform: translateY(-2px); border-color: rgba(24,124,76,.38); color: var(--primary); }
.copyright { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-muted); text-align: center; }
.modal-backdrop.show { opacity: .58; }
.installation-modal .modal-dialog { max-width: 920px; }

.installation-modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 30px 90px rgba(6,24,28,.30);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.installation-modal .modal-header { align-items: center; padding: 22px 26px; border-color: var(--line); background: var(--surface-muted); }
.modal-title-group { display: flex; align-items: center; gap: 14px; }
.modal-title-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 1.2rem; }
.modal-title-group h5 { margin: 0; font-weight: 750; }
.modal-title-group p { margin: 3px 0 0; color: var(--text-muted); font-size: .88rem; }
.installation-modal .close { color: var(--text); text-shadow: none; opacity: .68; }
.installation-modal .modal-body { max-height: min(72vh,760px); overflow-y: auto; padding: 26px; }
.installation-guide { display: grid; gap: 14px; counter-reset: install-step; }

.installation-step {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr);
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
    counter-increment: install-step;
}

.installation-step::before { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); content: counter(install-step, decimal-leading-zero); font-size: .78rem; font-weight: 800; }
.installation-step p { margin: 6px 0 0; font-weight: 650; line-height: 1.5; }
.installation-step img { width: 100%; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(18,48,52,.08); }
.installation-step code { display: inline-block; margin-top: 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface-strong); }

@keyframes panel-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-color-scheme: dark) {
    :root {
        --page-bg: #091216;
        --page-overlay: rgba(7,16,20,.26);
        --surface: rgba(12,22,27,.88);
        --surface-strong: rgba(12,22,27,.97);
        --surface-muted: rgba(26,39,44,.86);
        --text: #edf4f2;
        --text-muted: #a9bbb8;
        --line: rgba(190,220,214,.15);
        --primary: #56bd7d;
        --primary-hover: #70cc91;
        --primary-soft: rgba(86,189,125,.13);
        --shadow: 0 28px 80px rgba(0,0,0,.40);
        --background-image: url('/Resources/Images/welcome-ppe-dark.webp');
    }

    body::before { background: radial-gradient(circle at 50% 15%, rgba(46,86,91,.16), transparent 38%), linear-gradient(180deg, transparent 62%, rgba(0,0,0,.18)); }
}

@media (max-width: 760px) {
    body { background-attachment: scroll; background-position: center top; }
    .page-shell { width: min(100% - 20px,680px); padding-top: 18px; }
    .welcome-container { padding: 24px 20px 26px; border-radius: 20px; }
    .brand-row { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
    .footer { padding: 22px 20px 16px; }
    .footer-main { grid-template-columns: 1fr; gap: 22px; }
    .social-block { text-align: left; }
    .social-icons { justify-content: flex-start; }
    .installation-modal .modal-dialog { margin: 10px; }
    .installation-modal .modal-header, .installation-modal .modal-body { padding: 18px; }
    .installation-step { grid-template-columns: 36px minmax(0,1fr); gap: 10px; padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
