:root {
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-ink: #172033;
    --app-muted: #667085;
    --app-border: #e4e8f0;
    --app-surface: #ffffff;
    --app-background: #f4f7fb;
    --app-success: #15803d;
    --app-radius-lg: 24px;
    --app-radius-md: 16px;
    --app-shadow: 0 24px 70px rgba(37, 52, 85, 0.12);
}

/* Base document styles */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    background:
        radial-gradient(circle at 8% 5%, rgba(96, 165, 250, 0.18), transparent 30rem),
        radial-gradient(circle at 96% 14%, rgba(167, 139, 250, 0.15), transparent 26rem),
        var(--app-background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--app-primary);
}

.app-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.app-header {
    padding: 1.25rem 0;
}

.brand-mark {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 0.9rem;
    color: #ffffff;
    background: linear-gradient(145deg, #2563eb, #4f46e5);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.brand-title {
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
}

.brand-subtitle {
    color: var(--app-muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.language-button {
    min-height: 2.75rem;
    border-color: var(--app-border);
    border-radius: 0.9rem;
    color: var(--app-ink);
    background: rgba(255, 255, 255, 0.82);
}

.language-button:hover,
.language-button:focus {
    border-color: #b8c5dc;
    background: #ffffff;
}

.dropdown-menu {
    padding: 0.5rem;
    border-color: var(--app-border);
    border-radius: 1rem;
    box-shadow: 0 18px 50px rgba(23, 32, 51, 0.14);
}

.dropdown-item {
    border-radius: 0.65rem;
    padding: 0.62rem 0.8rem;
}

.app-main {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    padding: 1rem 0 3rem;
}

/* Login hero and authentication card */
.hero-panel {
    position: relative;
    height: 100%;
    min-height: 34rem;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: var(--app-radius-lg);
    color: #ffffff;
    background:
        radial-gradient(circle at 86% 15%, rgba(129, 140, 248, 0.75), transparent 18rem),
        linear-gradient(150deg, #14213d 0%, #203a72 58%, #294aa6 100%);
    box-shadow: var(--app-shadow);
}

.hero-panel::after {
    position: absolute;
    right: -5rem;
    bottom: -6rem;
    width: 20rem;
    height: 20rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    box-shadow: 0 0 0 2.6rem rgba(255, 255, 255, 0.035), 0 0 0 5.2rem rgba(255, 255, 255, 0.025);
    content: "";
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #eaf1ff;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-title {
    max-width: 34rem;
    margin: 1.3rem 0 1rem;
    font-size: clamp(2.35rem, 5vw, 4.65rem);
    font-weight: 760;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.hero-text {
    max-width: 36rem;
    margin: 0;
    color: rgba(239, 245, 255, 0.82);
    font-size: 1rem;
    line-height: 1.85;
}

.feature-list {
    display: grid;
    gap: 0.8rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f2f6ff;
    font-size: 0.92rem;
}

.feature-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    color: #dce8ff;
    background: rgba(255, 255, 255, 0.1);
}

.app-card {
    border: 1px solid rgba(228, 232, 240, 0.88);
    border-radius: var(--app-radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(16px);
}

.login-card {
    display: flex;
    min-height: 34rem;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.card-title {
    margin: 0;
    color: var(--app-ink);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 750;
    letter-spacing: -0.025em;
}

.card-subtitle {
    margin: 0.7rem 0 0;
    color: var(--app-muted);
    line-height: 1.65;
}

.form-label {
    margin-bottom: 0.5rem;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 700;
}

.form-control {
    min-height: 3.25rem;
    border-color: #d9e0eb;
    border-radius: 0.9rem;
    color: var(--app-ink);
    background: #ffffff;
}

.form-control:focus {
    border-color: #7aa2f7;
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.12);
}

.form-text {
    margin-top: 0.46rem;
    color: #78869b;
    font-size: 0.78rem;
    line-height: 1.5;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 3.25rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    z-index: 3;
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.7rem;
    color: #667085;
    background: transparent;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--app-primary);
    background: #eef4ff;
}

.btn-primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
}

.btn-app {
    min-height: 3.25rem;
    border-radius: 0.9rem;
    font-weight: 700;
}

.session-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #dbe7fa;
    border-radius: 0.85rem;
    color: #49617e;
    background: #f5f9ff;
    font-size: 0.78rem;
    line-height: 1.55;
}

.alert {
    border-radius: 0.9rem;
    font-size: 0.88rem;
}

.page-loader {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.loader-card {
    width: min(100%, 24rem);
    padding: 2rem;
    border: 1px solid var(--app-border);
    border-radius: 1.4rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--app-shadow);
}

.loader-icon {
    display: inline-flex;
    width: 3.5rem;
    height: 3.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 1.1rem;
    color: var(--app-primary);
    background: #eaf1ff;
}

/* Collapsible technology footer */
.app-footer {
    flex: 0 0 auto;
    padding: 0 0 1.25rem;
}

.footer-box {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
}

.footer-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border: 0;
    color: #526074;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
}

.footer-toggle .fa-chevron-down {
    transition: transform 0.2s ease;
}

.footer-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.footer-content {
    padding: 0 1rem 0.95rem;
    color: #78869b;
    font-size: 0.72rem;
    line-height: 1.65;
}

.footer-content p {
    margin: 0.1rem 0;
}

.installer-main {
    align-items: flex-start;
    padding-top: 0.5rem;
}

/* Installation progress and panels */
.installer-shell {
    padding: clamp(1rem, 3vw, 2rem);
}

.installer-heading {
    margin-bottom: 1.75rem;
}

.installer-heading .eyebrow {
    color: var(--app-primary-dark);
    border-color: #cfe0ff;
    background: #eef4ff;
}

.installer-title {
    margin: 0.9rem 0 0.55rem;
    font-size: clamp(1.8rem, 4vw, 2.85rem);
    font-weight: 780;
    letter-spacing: -0.035em;
}

.installer-subtitle {
    max-width: 50rem;
    margin: 0;
    color: var(--app-muted);
    line-height: 1.7;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.step-item {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    color: #7b8798;
    background: #f8fafc;
}

.step-number {
    display: inline-flex;
    width: 1.9rem;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #637083;
    background: #e9eef5;
    font-size: 0.78rem;
    font-weight: 800;
}

.step-label {
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-item.is-active {
    border-color: #a9c5ff;
    color: var(--app-primary-dark);
    background: #f3f7ff;
}

.step-item.is-active .step-number {
    color: #ffffff;
    background: var(--app-primary);
}

.step-item.is-complete {
    color: var(--app-success);
}

.step-item.is-complete .step-number {
    color: #ffffff;
    background: var(--app-success);
}

.installer-panel {
    padding: clamp(1.1rem, 3vw, 2rem);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: #ffffff;
}

.panel-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 750;
}

.panel-text {
    margin: 0.45rem 0 0;
    color: var(--app-muted);
    line-height: 1.65;
}

.requirements-table {
    min-width: 680px;
    margin-bottom: 0;
}

.requirements-table th {
    color: #5f6c80;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 750;
}

.requirements-table td {
    color: #455267;
    font-size: 0.82rem;
    vertical-align: middle;
}

.installer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.installer-actions .btn {
    min-height: 2.9rem;
    min-width: 8.5rem;
    border-radius: 0.8rem;
    font-weight: 700;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.3rem;
}

.summary-item {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: #f8fafc;
}

.summary-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #7b8798;
    font-size: 0.72rem;
    font-weight: 700;
}

.summary-value {
    display: block;
    overflow-wrap: anywhere;
    color: var(--app-ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.success-illustration {
    display: inline-flex;
    width: 5rem;
    height: 5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border-radius: 1.5rem;
    color: #ffffff;
    background: linear-gradient(145deg, #16a34a, #15803d);
    box-shadow: 0 18px 35px rgba(22, 163, 74, 0.22);
    font-size: 2rem;
}

.dashboard-shell {
    width: min(100%, 58rem);
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 3.5rem);
}

/* Authenticated management page */
.dashboard-icon {
    display: inline-flex;
    width: 4.5rem;
    height: 4.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.4rem;
    color: #ffffff;
    background: linear-gradient(145deg, #2563eb, #4f46e5);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.25);
    font-size: 1.7rem;
}

.dashboard-title {
    margin: 1.25rem 0 0.7rem;
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 780;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.dashboard-description {
    max-width: 43rem;
    margin: 0;
    color: var(--app-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 2rem 0 1rem;
}

.status-card {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: #f8fafc;
}

.status-card dt {
    margin-bottom: 0.35rem;
    color: #7a8799;
    font-size: 0.73rem;
    font-weight: 700;
}

.status-card dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--app-ink);
    font-weight: 750;
}

.security-box {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border: 1px solid #d4e3fb;
    border-radius: 1rem;
    background: #f4f8ff;
}

.security-box i {
    margin-top: 0.18rem;
    color: var(--app-primary);
}

.security-box strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #304769;
}

.security-box p {
    margin: 0;
    color: #5f7391;
    font-size: 0.82rem;
    line-height: 1.6;
}

@media (max-width: 991.98px) {
    .hero-panel,
    .login-card {
        min-height: auto;
    }

    .hero-panel {
        padding: 2rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.2rem);
    }

    .stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .app-header {
        padding: 0.85rem 0;
    }

    .brand-subtitle {
        display: none;
    }

    .language-button {
        min-width: 2.75rem;
        padding-right: 0.72rem;
        padding-left: 0.72rem;
    }

    .language-button .current-language,
    .language-button .language-label {
        display: none;
    }

    .app-main {
        align-items: flex-start;
        padding: 0.35rem 0 2rem;
    }

    .hero-panel {
        padding: 1.5rem;
        border-radius: 1.3rem;
    }

    .hero-text {
        line-height: 1.7;
    }

    .feature-list {
        gap: 0.6rem;
        margin-top: 1.4rem;
    }

    .feature-list li {
        font-size: 0.82rem;
    }

    .login-card,
    .dashboard-shell {
        padding: 1.35rem;
        border-radius: 1.3rem;
    }

    .footer-content {
        padding-bottom: 0.8rem;
    }

    .installer-shell {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .stepper {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .step-item {
        padding: 0.65rem 0.75rem;
    }

    .step-label {
        white-space: normal;
    }

    .installer-panel {
        padding: 1rem;
    }

    .installer-actions {
        flex-direction: column-reverse;
    }

    .installer-actions .btn {
        width: 100%;
    }

    .summary-grid,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
