/* =========================================================
   CONNECT SMART
   FINAL CSS
========================================================= */

:root {

    --blue: #1C85C7;
    --blue-dark: #176FA7;
    --blue-light: #EAF5FC;

    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;

    --white: #FFFFFF;

}


/* =========================================================
   RESET
========================================================= */

* {

    box-sizing: border-box;

    -webkit-tap-highlight-color: transparent;

}


html,
body {

    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--gray-50);

    color: var(--gray-800);

}


body {

    overflow-x: hidden;

    -webkit-text-size-adjust: 100%;

    touch-action: manipulation;

}


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

.top-header {

    width: 100%;

    min-height: 76px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 13px 28px;

    background: var(--white);

    border-bottom: 1px solid var(--gray-200);

}


/* =========================================================
   BRAND
========================================================= */

.header-brand {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

}


.app-logo {

    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background: var(--blue);

    color: var(--white);

    font-size: 19px;

    box-shadow:
        0 4px 10px rgba(
            28,
            133,
            199,
            0.18
        );

}


.brand-text {

    min-width: 0;

}


.brand-text h1 {

    margin: 0;

    font-size: 20px;

    line-height: 1.2;

    font-weight: 700;

    color: var(--gray-800);

    white-space: nowrap;

}


.brand-text p {

    margin: 4px 0 0;

    font-size: 12px;

    line-height: 1.2;

    color: var(--gray-500);

    white-space: nowrap;

}


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

.header-controls {

    display: flex;

    align-items: center;

    gap: 9px;

    flex-shrink: 0;

}


/* =========================================================
   DEFAULT MODE
========================================================= */

.default-badge {

    height: 40px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 0 13px;

    border-radius: 10px;

    background: var(--gray-100);

    color: var(--gray-600);

    font-size: 12px;

    white-space: nowrap;

}


.default-badge i {

    color: var(--blue);

}


/* =========================================================
   ACTIVE MODE
========================================================= */

.mode-badge {

    min-height: 44px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 5px 13px 5px 6px;

    border-radius: 11px;

    background: var(--gray-100);

    white-space: nowrap;

}


.mode-icon {

    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 8px;

    background: var(--blue);

    color: var(--white);

    font-size: 13px;

}


.mode-content {

    display: flex;

    flex-direction: column;

    justify-content: center;

}


.mode-content small {

    font-size: 9px;

    line-height: 1.1;

    color: var(--gray-500);

}


.mode-content strong {

    margin-top: 2px;

    font-size: 12px;

    line-height: 1.2;

    color: var(--gray-700);

}


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

.header-button {

    height: 40px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 0 15px;

    border: none;

    border-radius: 10px;

    background: var(--blue);

    color: var(--white);

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        transform 0.15s ease;

}


.header-button:hover {

    background: var(--blue-dark);

}


.header-button:active {

    transform: scale(0.97);

}


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

main {

    width: 100%;

    max-width: 1180px;

    margin: 0 auto;

    padding: 40px 28px 55px;

}


/* =========================================================
   WELCOME
========================================================= */

.welcome {

    margin-bottom: 27px;

}


.welcome h2 {

    margin: 0;

    font-size: 25px;

    line-height: 1.25;

    font-weight: 700;

    color: var(--gray-800);

}


.welcome p {

    margin: 7px 0 0;

    font-size: 14px;

    color: var(--gray-500);

}


/* =========================================================
   MENU GRID
========================================================= */

.menu {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(190px, 1fr)
        );

    gap: 17px;

}


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

.menu-item {

    min-height: 185px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 23px 18px;

    border: 1px solid var(--gray-200);

    border-radius: 16px;

    background: var(--white);

    color: inherit;

    text-decoration: none;

    text-align: center;

    box-shadow:
        0 2px 8px rgba(
            0,
            0,
            0,
            0.035
        );

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;

}


.menu-item:hover {

    transform: translateY(-3px);

    border-color: var(--blue);

    box-shadow:
        0 9px 24px rgba(
            28,
            133,
            199,
            0.11
        );

}


/* =========================================================
   DISABLED MENU
========================================================= */

.menu-item.disabled {

    cursor: default;

    opacity: 0.55;

}


.menu-item.disabled:hover {

    transform: none;

    border-color: var(--gray-200);

    box-shadow:
        0 2px 8px rgba(
            0,
            0,
            0,
            0.035
        );

}


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

.menu-icon {

    width: 58px;
    height: 58px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 14px;

    border-radius: 14px;

    background: var(--blue-light);

    color: var(--blue);

    font-size: 23px;

}


/* =========================================================
   MENU TITLE
========================================================= */

.menu-item h3 {

    width: 100%;

    margin: 0;

    font-size: 16px;

    line-height: 1.3;

    font-weight: 600;

    color: var(--gray-800);

}


/* =========================================================
   MENU DESCRIPTION
========================================================= */

.menu-item p {

    width: 100%;

    margin: 6px 0 0;

    font-size: 12px;

    line-height: 1.45;

    color: var(--gray-500);

}


/* =========================================================
   MENU STATUS
========================================================= */

.menu-status {

    display: inline-block;

    margin-top: 8px;

    padding: 4px 9px;

    border-radius: 6px;

    background: var(--gray-100);

    color: var(--gray-500);

    font-size: 10px;

    font-weight: 500;

    line-height: 1.2;

}


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

footer {

    padding: 20px;

    text-align: center;

    font-size: 11px;

    color: var(--gray-500);

}


/* =========================================================
   PIN MODAL
========================================================= */

.modal {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(
            31,
            41,
            55,
            0.45
        );

    backdrop-filter: blur(4px);

}


.modal.show {

    display: flex;

}


/* =========================================================
   PIN BOX
========================================================= */

.pin-box {

    width: 100%;

    max-width: 340px;

    padding: 28px 24px 24px;

    border-radius: 20px;

    background: var(--white);

    text-align: center;

    box-shadow:
        0 20px 60px rgba(
            0,
            0,
            0,
            0.18
        );

}


.pin-icon {

    width: 50px;
    height: 50px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 0 auto 15px;

    border-radius: 14px;

    background: var(--blue);

    color: var(--white);

    font-size: 18px;

}


.pin-box h3 {

    margin: 0;

    font-size: 19px;

    color: var(--gray-800);

}


.pin-box > p {

    margin: 7px 0 20px;

    font-size: 12px;

    line-height: 1.5;

    color: var(--gray-500);

}


/* =========================================================
   PIN DOTS
========================================================= */

.pin-display {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    margin-bottom: 10px;

}


.pin-dot {

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: var(--gray-300);

}


.pin-dot.active {

    background: var(--blue);

}


/* =========================================================
   PIN ERROR
========================================================= */

.pin-error {

    min-height: 18px;

    margin-bottom: 8px;

    font-size: 11px;

    color: #DC2626;

}


/* =========================================================
   KEYPAD
========================================================= */

.keypad {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 9px;

}


.key {

    height: 48px;

    border: 1px solid var(--gray-200);

    border-radius: 11px;

    background: var(--gray-50);

    color: var(--gray-800);

    font-family: inherit;

    font-size: 17px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.12s ease,
        transform 0.12s ease;

}


.key:hover {

    background: var(--blue-light);

    color: var(--blue);

}


.key:active {

    transform: scale(0.96);

}


.key.clear {

    color: var(--gray-500);

}


.key.zero {

    grid-column: 2;

}


/* =========================================================
   CANCEL
========================================================= */

.cancel-btn {

    width: 100%;

    height: 44px;

    margin-top: 12px;

    border: none;

    border-radius: 10px;

    background: var(--gray-100);

    color: var(--gray-600);

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

}


.cancel-btn:hover {

    background: var(--gray-200);

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 800px) {

    .top-header {

        padding:
            13px 18px;

    }


    main {

        padding:
            34px 18px 50px;

    }


    .menu {

        grid-template-columns:
            repeat(
                auto-fill,
                minmax(175px, 1fr)
            );

    }

}


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

@media (max-width: 600px) {

    .top-header {

        min-height: 64px;

        padding:
            11px 14px;

        gap: 10px;

    }


    .header-brand {

        gap: 9px;

    }


    .app-logo {

        width: 40px;
        height: 40px;

        flex-basis: 40px;

        border-radius: 10px;

        font-size: 16px;

    }


    .brand-text h1 {

        font-size: 16px;

    }


    .brand-text p {

        margin-top: 2px;

        font-size: 9px;

    }


    .header-controls {

        gap: 6px;

    }


    .default-badge {

        display: none;

    }


    .mode-badge {

        min-height: 38px;

        padding:
            4px 9px 4px 5px;

        border-radius: 9px;

    }


    .mode-icon {

        width: 29px;
        height: 29px;

        flex-basis: 29px;

        border-radius: 7px;

        font-size: 11px;

    }


    .mode-content small {

        font-size: 8px;

    }


    .mode-content strong {

        font-size: 10px;

    }


    .header-button {

        width: 38px;
        height: 38px;

        padding: 0;

        border-radius: 9px;

    }


    .header-button span {

        display: none;

    }


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

    main {

        padding:
            28px 14px 45px;

    }


    .welcome {

        margin-bottom: 21px;

    }


    .welcome h2 {

        font-size: 21px;

    }


    .welcome p {

        margin-top: 5px;

        font-size: 12px;

    }


    /* =====================================================
       MENU
    ===================================================== */

    .menu {

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

        gap: 11px;

    }


    .menu-item {

        min-height: 165px;

        padding: 19px 12px;

        border-radius: 14px;

    }


    .menu-icon {

        width: 50px;
        height: 50px;

        margin-bottom: 12px;

        border-radius: 12px;

        font-size: 20px;

    }


    .menu-item h3 {

        font-size: 15px;

    }


    .menu-item p {

        margin-top: 6px;

        font-size: 11px;

        line-height: 1.4;

    }


    .menu-status {

        margin-top: 7px;

        padding: 4px 8px;

        font-size: 9px;

    }

}


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

@media (max-width: 380px) {

    .top-header {

        padding:
            10px 11px;

    }


    .app-logo {

        width: 36px;
        height: 36px;

        flex-basis: 36px;

    }


    .brand-text h1 {

        font-size: 14px;

    }


    .brand-text p {

        display: none;

    }


    .mode-content {

        display: none;

    }


    .mode-badge {

        width: 36px;
        height: 36px;

        min-height: 36px;

        padding: 3px;

        justify-content: center;

    }


    .mode-icon {

        width: 30px;
        height: 30px;

    }


    .header-button {

        width: 36px;
        height: 36px;

    }


    .menu {

        gap: 9px;

    }


    .menu-item {

        min-height: 160px;

        padding:
            17px 9px;

    }


    .menu-icon {

        width: 46px;
        height: 46px;

        margin-bottom: 10px;

        font-size: 19px;

    }


    .menu-item h3 {

        font-size: 14px;

    }


    .menu-item p {

        font-size: 10px;

    }


    .menu-status {

        font-size: 9px;

        padding: 3px 7px;

    }

}


/* =========================================================
   REDUCE MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        transition: none !important;

        animation: none !important;

    }

}