/* =========================================================
   KYO32G - STYLE
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: #080d12;
    color: #e8edf3;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

.hidden {
    display: none !important;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 35px;
    background: #111820;
    border: 1px solid #273441;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card .brand {
    margin-bottom: 5px;
}

.login-card .subtitle {
    margin-bottom: 28px;
}

.login-card input {
    width: 100%;
    height: 46px;
    margin-bottom: 12px;
    padding: 0 14px;
    background: #080d12;
    color: #ffffff;
    border: 1px solid #344352;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.login-card input:focus {
    border-color: #4d7fb5;
}

.login-card button {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    background: #3474a9;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.error {
    min-height: 22px;
    margin-top: 12px;
    color: #ff7373;
    font-size: 14px;
}


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

header {
    height: 107px;
    padding: 25px 26px;

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

    background: #090e13;
    border-bottom: 1px solid #26313c;
}

.brand {
    color: #f1f4f7;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 1px;
}

.subtitle {
    margin-top: 4px;
    color: #9fb0c2;
    font-size: 16px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* =========================================================
   CONNECTION
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 102px;
    height: 32px;
    padding: 0 14px;

    border-radius: 18px;

    font-size: 13px;
    font-weight: 800;
}

.badge.online {
    background: #0f4d35;
    color: #55e69c;
}

.badge.offline {
    background: #4b2025;
    color: #ff8585;
}


/* =========================================================
   GENERIC BUTTON
   ========================================================= */

button {
    font-family: inherit;
}

.small {
    height: 34px;
    padding: 0 14px;

    border: 0;
    border-radius: 8px;

    background: #273342;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.small:hover {
    filter: brightness(1.1);
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    width: 100%;
    max-width: 1060px;

    margin: 28px auto 40px;
    padding: 0 10px;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    min-height: 145px;

    display: flex;
    align-items: center;

    padding: 25px 28px;

    background: #121920;
    border: 1px solid #293642;
    border-radius: 18px;

    /*
     * Spazio fisso tra titolo e pulsanti.
     */
    gap: 38px;
}


/* =========================================================
   BLOCCO TITOLO
   ========================================================= */

.hero > div:first-child {
    /*
     * Questa è la parte fondamentale.
     *
     * Deve essere abbastanza larga per contenere
     * anche "SISTEMA DISINSERITO".
     */
    flex: 0 0 395px;
    width: 395px;
    min-width: 395px;
}

.big-status {
    margin: 0;

    color: #f2f4f7;

    /*
     * Un po' più piccolo rispetto a prima.
     * Rimane comunque molto evidente.
     */
    font-size: 29px;
    line-height: 1.1;
    font-weight: 800;

    white-space: nowrap;
}

.clock {
    margin-top: 9px;

    color: #a9c3dd;

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

    white-space: nowrap;
}


/* =========================================================
   AZIONI
   ========================================================= */

.actions {
    flex: 1;

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

    gap: 10px;

    min-width: 0;
}

.action {
    height: 44px;

    padding: 0 15px;

    border: 0;
    border-radius: 9px;

    color: #ffffff;

    font-size: 13px;
    font-weight: 800;

    white-space: nowrap;

    cursor: pointer;

    transition:
        filter 0.15s ease,
        transform 0.05s ease;
}

.action:hover {
    filter: brightness(1.1);
}

.action:active {
    transform: translateY(1px);
}

.action:disabled {
    opacity: 0.65;
    cursor: wait;
}

.action.arm {
    background: #16834f;
}

.action.disarm {
    background: #9e3038;
}

.action.sync {
    background: #32628f;
}

/* =========================================================
   COMANDI SECONDARI
   ========================================================= */

.secondary-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.reset-alarm {
    height: 34px;

    padding: 0 15px;

    border: 1px solid #6b3035;
    border-radius: 8px;

    background: #25171a;
    color: #e98585;

    font-family: inherit;
    font-size: 12px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.reset-alarm:hover {
    background: #63272d;
    border-color: #a9474e;
    color: #ffffff;
}

.reset-alarm:active {
    transform: translateY(1px);
}

.reset-alarm:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* =========================================================
   SEZIONI
   ========================================================= */

section {
    margin-top: 28px;
}

section h2 {
    margin: 0 0 11px;

    color: #8fa3b7;

    font-size: 13px;
    font-weight: 500;

    letter-spacing: 2px;
}


/* =========================================================
   CARDS
   ========================================================= */

.cards {
    display: grid;
    gap: 12px;
}

.areas {
    grid-template-columns: repeat(3, 1fr);
}

.status-grid {
    grid-template-columns: repeat(4, 1fr);
}

.card {
    min-height: 57px;

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

    padding: 0 17px;

    background: #121920;
    border: 1px solid #293642;
    border-radius: 14px;

    color: #b8c5d2;
}

.card b {
    color: #f0f3f6;
    font-size: 16px;
}


/* =========================================================
   ZONE
   ========================================================= */

.zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.zone {
    min-height: 63px;

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

    padding: 0 16px;

    background: #121920;
    border: 1px solid #293642;
    border-radius: 14px;
}

.zone-name {
    color: #f0f3f6;
    font-size: 16px;
    font-weight: 700;
}

.zone-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 82px;
    height: 30px;

    padding: 0 10px;

    border-radius: 16px;

    font-size: 12px;
    font-weight: 800;
}

.zone-status.normal {
    background: #103d2c;
    color: #53df99;
}

.zone-status.active {
    background: #69252a;
    color: #ff8a8a;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    main {
        max-width: 100%;
        padding: 0 18px;
    }

    .hero {
        gap: 25px;
    }

    .hero > div:first-child {
        flex-basis: 365px;
        width: 365px;
        min-width: 365px;
    }

    .big-status {
        font-size: 27px;
    }

    .action {
        padding: 0 11px;
        font-size: 12px;
    }
}


@media (max-width: 900px) {

    .hero {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .hero > div:first-child {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .areas {
        grid-template-columns: 1fr;
    }

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

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


@media (max-width: 600px) {

    header {
        height: auto;
        min-height: 90px;
        padding: 20px 16px;
    }

    .brand {
        font-size: 25px;
    }

    .subtitle {
        font-size: 14px;
    }

    .top-right {
        gap: 6px;
    }

    .badge {
        min-width: auto;
        padding: 0 10px;
        font-size: 11px;
    }

    .small {
        padding: 0 10px;
        font-size: 12px;
    }

    main {
        margin-top: 16px;
        padding: 0 12px;
    }

    .hero {
        padding: 20px;
    }

    .big-status {
        font-size: 25px;
    }

    .clock {
        font-size: 23px;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .action {
        width: 100%;
    }

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

    .zones {
        grid-template-columns: 1fr;
    }
}