* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    color: #f5f5f7;

    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(124, 140, 255, 0.20),
            transparent 45%
        ),
        #0b0d10;

    -webkit-font-smoothing: antialiased;
}


/* ==============================
   CONTAINER
   ============================== */

.container {
    width: calc(100% - 40px);
    max-width: 900px;

    margin: 0 auto;

    padding-top: 70px;
    padding-bottom: 40px;
}


/* ==============================
   HEADER
   ============================== */

.header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-icon {
    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 17px;

    box-shadow:
        0 10px 35px rgba(100, 115, 255, 0.28);
}

.logo-icon img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}

.logo-text h1 {
    font-size: 30px;
    line-height: 1.1;

    font-weight: 700;

    letter-spacing: -0.7px;
}

.logo-text p {
    margin-top: 5px;

    color: #a7a9b2;

    font-size: 15px;
}


/* ==============================
   SERVICES
   ============================== */

.services {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;

    width: 100%;
}


/* ==============================
   CARD
   ============================== */

.service-card {
    width: 100%;
    min-width: 0;
    min-height: 105px;

    display: flex;
    align-items: center;

    padding: 20px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 22px;

    background:
        rgba(255, 255, 255, 0.055);

    color: #f5f5f7;

    text-decoration: none;

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    transition:
        transform 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.service-card:hover {
    transform: translateY(-3px);

    background:
        rgba(255, 255, 255, 0.085);

    border-color:
        rgba(255, 255, 255, 0.16);

    box-shadow:
        0 15px 45px
        rgba(0, 0, 0, 0.25);
}

.service-card:active {
    transform: scale(0.985);
}


/* ==============================
   ICON
   ============================== */

.service-icon {
    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 17px;

    border-radius: 16px;
}

.service-icon img {
    width: 32px;
    height: 32px;

    display: block;

    object-fit: contain;
}


/* Couleurs des services */

.homeassistant {
    background: #18a5d6;
}

.jellyfin {
    background: #6b4ba3;
}

.nextcloud {
    background: #0082c9;
}

.vaultwarden {
    background: #175ddc;
}


/* ==============================
   TEXT
   ============================== */

.service-info {
    min-width: 0;
    flex: 1 1 auto;
}

.service-info h2 {
    font-size: 17px;
    line-height: 1.3;

    font-weight: 650;

    letter-spacing: -0.2px;
}

.service-info p {
    margin-top: 5px;

    color: #a7a9b2;

    font-size: 14px;
    line-height: 1.3;
}


/* ==============================
   ARROW
   ============================== */

.arrow {
    flex: 0 0 auto;

    margin-left: 15px;

    color: #777b86;

    font-size: 22px;
    line-height: 1;

    transition:
        transform 180ms ease,
        color 180ms ease;
}

.service-card:hover .arrow {
    color: #f5f5f7;

    transform: translateX(4px);
}


/* ==============================
   FOOTER
   ============================== */

footer {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    margin-top: 40px;

    color: #686b75;

    font-size: 13px;
}

.separator {
    opacity: 0.5;
}


/* ==============================
   MOBILE
   ============================== */

@media (max-width: 650px) {

    .container {
        width: calc(100% - 28px);

        padding-top: 40px;
        padding-bottom: 30px;
    }

    .header {
        margin-bottom: 30px;
    }

    .logo {
        gap: 15px;
    }

    .logo-icon {
        width: 52px;
        height: 52px;

        flex-basis: 52px;

        border-radius: 15px;

        font-size: 23px;
    }

    .logo-text h1 {
        font-size: 26px;
    }

    .logo-text p {
        font-size: 14px;
    }

    .services {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        min-height: 92px;
        padding: 16px;
        border-radius: 19px;
    }

    .service-icon {
        width: 52px;
        height: 52px;

        flex-basis: 52px;

        margin-right: 15px;

        border-radius: 14px;
    }

    .service-icon img {
        width: 29px;
        height: 29px;
    }

    .service-info h2 {
        font-size: 16px;
    }

    .service-info p {
        font-size: 13px;
    }

    .arrow {
        font-size: 20px;
    }

    footer {
        margin-top: 32px;
        font-size: 12px;
    }
}

/* =========================
   ERROR POPUP
   ========================= */

.error-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.error-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.error-popup {
    position: relative;

    width: min(440px, 100%);

    padding: 32px;

    border-radius: 24px;

    background: #171a20;
    border: 1px solid rgba(255,255,255,0.08);

    box-shadow:
        0 25px 80px rgba(0,0,0,0.5);

    text-align: center;

    transform: scale(0.92) translateY(10px);

    transition: transform 0.25s ease;
}

.error-popup-overlay.show .error-popup {
    transform: scale(1) translateY(0);
}

.error-popup-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 20px;

    background: rgba(255, 180, 0, 0.12);

    font-size: 30px;
}

.error-popup h2 {
    margin: 0 0 14px;

    font-size: 22px;
}

.error-popup p {
    margin: 0;

    color: #b7bcc7;

    line-height: 1.6;
}

.error-code {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 8px;

    background: rgba(255,255,255,0.06);

    font-size: 13px;
    color: #8f96a3;
}

.error-popup-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,0.06);

    color: #fff;

    font-size: 22px;

    cursor: pointer;
}

.error-popup-button {
    width: 100%;

    margin-top: 24px;

    padding: 12px 18px;

    border: 0;
    border-radius: 14px;

    background: #fff;
    color: #111;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.error-popup-button:hover {
    opacity: 0.9;
}