:root {
    --bg: #0B1120;
    --surface: #111C2E;
    --border: #233149;
    --primary: #38BDF8;
    --text: #F1F5F9;
    --muted: #94A3B8;
    --purple: #A5B4FC;
    --gold: #FBBF24;
    --green: #22C55E;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    color-scheme: dark;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: 0;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

#app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* APP HEADER */

.app-header {
    flex-shrink: 0;
    min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 20;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline: auto;
    font-size: 16px;
    font-weight: bold;
}

.header-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--primary);
}

/* HOME SCREEN */

.home-screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 20px 18px;
    overscroll-behavior: contain;
}

.brand-section {
    text-align: center;
    padding: 12px 0 28px;
}

.main-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 0 35px rgba(56,189,248,.12);
}

.brand-section h1 {
    direction: ltr;
    font-size: 30px;
    margin: 15px 0 8px;
    letter-spacing: -.5px;
}

.brand-section h1 span {
    color: var(--primary);
}

.brand-section h2 {
    font-size: 20px;
    margin: 0 0 10px;
}

.brand-section p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

/* SERVICE CARDS */

.services {
    display: grid;
    gap: 14px;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 105px;
    padding: 18px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    text-align: right;
    transition: background .2s, border-color .2s,
                transform .2s;
}

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

.service-card:hover {
    border-color: var(--primary);
    background: #16243A;
}

.service-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 25px;
    border-radius: 15px;
}

.digital .service-icon {
    color: var(--primary);
    background: rgba(56,189,248,.10);
}

.smm .service-icon {
    color: var(--purple);
    background: rgba(165,180,252,.10);
}

.blog .service-icon {
    color: var(--gold);
    background: rgba(251,191,36,.10);
}

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

.service-content h3 {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 6px;
}

.service-content p {
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
    margin: 0;
}

.arrow {
    color: var(--muted);
    font-size: 13px;
}

/* CONTACT AND INSTALL */

.contact-button,
.install-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px;
    border-radius: 14px;
    font-weight: bold;
    font-size: 15px;
    margin-top: 16px;
}

.contact-button {
    background: #166534;
    color: #FFFFFF;
}

.contact-button i {
    font-size: 23px;
}

.install-button {
    background: #0369A1;
    color: #FFFFFF;
}

.home-footer {
    text-align: center;
    padding: 22px 0 8px;
    color: var(--muted);
    font-size: 11px;
}

.home-footer small {
    opacity: .8;
}

/* INTERNAL WEBSITE VIEWER */

.viewer-screen {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

#siteFrame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #FFFFFF;
}

.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--muted);
    pointer-events: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* BOTTOM NAVIGATION */

.bottom-nav {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    z-index: 20;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 53px;
    padding: 7px 4px;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
}

.nav-item i {
    font-size: 19px;
}

.nav-item span {
    font-size: 11px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(56,189,248,.08);
}

/* RESPONSIVE */

@media (min-width: 768px) {
    .home-screen {
        padding: 28px 24px;
    }

    .main-logo {
        width: 120px;
        height: 120px;
    }

    .service-card {
        min-height: 115px;
        padding: 20px;
    }

    .bottom-nav {
        padding-inline: max(8px, calc((100% - 580px) / 2));
    }
}

@media (max-width: 360px) {
    .home-screen {
        padding-inline: 12px;
    }

    .service-card {
        padding: 12px;
        gap: 10px;
    }

    .service-content h3 {
        font-size: 14px;
    }

    .service-icon {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* V2 - Compact App Header */

.header-brand img {
    display: none;
}

.app-header {
    min-height: 48px;
    padding: calc(5px + env(safe-area-inset-top)) 12px 5px;
}

.header-brand {
    font-size: 15px;
}

.app-header .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

/* V3 - Responsive Home Layout */

.home-screen {
    scrollbar-width: thin;
    scrollbar-color: #233149 transparent;
}

.brand-section {
    padding: 8px 0 20px;
}

.main-logo {
    width: 85px;
    height: 85px;
}

.brand-section h1 {
    font-size: 26px;
    margin: 10px 0 5px;
}

.brand-section h2 {
    font-size: 18px;
    margin-bottom: 6px;
}

.services {
    gap: 12px;
}

.service-card {
    min-height: 85px;
    padding: 14px;
}

.contact-button,
.install-button {
    min-height: 46px;
    margin-top: 12px;
}

.home-footer {
    padding: 15px 0 5px;
}

/* Desktop and Tablet Layout */

@media (min-width: 768px) {

    .home-screen {
        max-width: 1100px;
        padding: 20px 24px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
        align-content: start;
    }

    .brand-section,
    .services,
    .home-footer {
        grid-column: 1 / -1;
    }

    .brand-section {
        padding: 4px 0 22px;
    }

    .main-logo {
        width: 90px;
        height: 90px;
    }

    .services {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .service-card {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        min-height: 180px;
        padding: 20px 14px;
        gap: 12px;
        position: relative;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        border-radius: 18px;
    }

    .service-content {
        flex: 0 1 auto;
    }

    .service-content h3 {
        font-size: 17px;
        margin-bottom: 8px;
    }

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

    .service-card .arrow {
        position: absolute;
        left: 14px;
        top: 16px;
    }

    .contact-button,
    .install-button {
        margin-top: 16px;
    }

    .contact-button:has(+ .install-button[hidden]) {
        grid-column: 1 / -1;
    }

    .home-footer {
        padding-top: 18px;
    }
}

/* Small Mobile Screens */

@media (max-width: 480px) {

    .home-screen {
        padding: 12px 14px;
    }

    .main-logo {
        width: 75px;
        height: 75px;
    }

    .brand-section {
        padding-bottom: 16px;
    }

    .service-card {
        min-height: 80px;
    }

    .service-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }

    .service-content h3 {
        font-size: 14px;
    }

    .service-content p {
        font-size: 11px;
    }

    .bottom-nav {
        padding-top: 4px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
    }

    .nav-item {
        min-height: 48px;
    }
}

/* CONTACT MODAL V1 */

.contact-modal {
    position: fixed;
    inset: 0;
    width: calc(100% - 28px);
    max-width: 460px;
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #111C2E;
    color: #F1F5F9;
    border: 1px solid #233149;
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.contact-modal::backdrop {
    background: rgba(3,7,18,.78);
    backdrop-filter: blur(5px);
}

.contact-modal[open] {
    animation: contactModalIn .2s ease-out;
}

@keyframes contactModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* MODAL HEADER */

.contact-modal-header {
    position: relative;
    text-align: center;
    margin-bottom: 22px;
}

.modal-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: #1E293B;
    color: #94A3B8;
    border-radius: 10px;
    font-size: 18px;
}

.modal-close:hover {
    background: #334155;
    color: #FFFFFF;
}

.contact-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(34,197,94,.12);
    color: #22C55E;
    font-size: 34px;
}

.contact-modal-header h2 {
    font-size: 21px;
    margin: 0 0 8px;
}

.contact-modal-header p {
    color: #94A3B8;
    font-size: 13px;
    margin: 0;
}

/* FORM FIELDS */

#contactForm {
    display: grid;
    gap: 14px;
}

.contact-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-modal label {
    font-size: 13px;
    font-weight: bold;
    color: #E2E8F0;
}

.contact-modal input,
.contact-modal select,
.contact-modal textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid #334155;
    border-radius: 11px;
    background: #0B1120;
    color: #F1F5F9;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    color-scheme: dark;
}

.contact-modal textarea {
    resize: vertical;
    min-height: 85px;
    max-height: 200px;
    line-height: 1.7;
}

.contact-modal input::placeholder,
.contact-modal textarea::placeholder {
    color: #64748B;
    font-size: 13px;
}

.contact-modal input:focus,
.contact-modal select:focus,
.contact-modal textarea:focus {
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56,189,248,.08);
}

.contact-modal select:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* CONTACT BUTTONS */

.contact-submit,
.contact-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    transition: background .2s;
}

.contact-submit {
    background: #166534;
    color: #FFFFFF;
}

.contact-submit:hover {
    background: #15803D;
}

.contact-submit i {
    font-size: 23px;
}

.contact-call {
    background: rgba(56,189,248,.08);
    color: #38BDF8;
    border: 1px solid #164E63;
}

.contact-call:hover:not(:disabled) {
    background: rgba(56,189,248,.15);
}

.contact-call:disabled,
.contact-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.contact-modal-footer {
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
    margin: 18px 0 0;
}

/* MOBILE */

@media (max-width: 480px) {

    .contact-modal {
        padding: 18px;
        border-radius: 18px;
    }

    .contact-modal-header {
        margin-bottom: 16px;
    }

    .contact-modal-icon {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }

    .contact-modal-header h2 {
        font-size: 18px;
    }

    #contactForm {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-modal[open] {
        animation: none;
    }
}

/* CONTACT MODAL V2 - Compact Layout */

.contact-modal {
    max-width: 480px;
    padding: 18px 22px;
    max-height: 94dvh;
}

.contact-modal-header {
    margin-bottom: 12px;
}

.contact-modal-icon {
    width: 44px;
    height: 44px;
    font-size: 26px;
    margin-bottom: 8px;
    border-radius: 12px;
}

.contact-modal-header h2 {
    font-size: 19px;
    margin-bottom: 5px;
}

#contactForm {
    gap: 9px;
}

.contact-modal .form-group {
    gap: 5px;
}

.contact-modal input,
.contact-modal select {
    min-height: 40px;
    padding: 8px 12px;
}

.contact-modal textarea {
    min-height: 60px;
    height: 60px;
    padding: 8px 12px;
}

.contact-submit,
.contact-call {
    min-height: 42px;
    padding: 8px;
}

.contact-modal-footer {
    margin-top: 10px;
}

@media (max-width: 480px) {
    .contact-modal {
        padding: 14px;
    }
}


/* DYNAMIC HOME V1 - TICKER */

.ts-service-ticker {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.ts-ticker-label {
    flex: 0 0 42px;
    align-self: stretch;
    display: grid;
    place-items: center;
    color: var(--gold);
    background: rgba(251,191,36,.08);
    border-inline-end: 1px solid var(--border);
}

.ts-ticker-window {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    direction: ltr;
}

.ts-ticker-track {
    display: flex;
    width: max-content;
    animation: tsTickerMove 36s linear infinite;
    animation-play-state: paused;
}

.ts-motion-ready .ts-ticker-track {
    animation-play-state: running;
}

.ts-ticker-group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    direction: rtl;
}

.ts-ticker-group span {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary);
}

.ts-ticker-group span::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-inline-start: 18px;
    border-radius: 50%;
    background: var(--gold);
}

.ts-motion-toggle {
    flex: 0 0 44px;
    min-height: 44px;
    background: transparent;
    color: var(--muted);
    border-inline-start: 1px solid var(--border);
}

.ts-service-ticker:hover .ts-ticker-track,
.ts-service-ticker:focus-within .ts-ticker-track,
.ts-motion-paused .ts-ticker-track {
    animation-play-state: paused;
}

@keyframes tsTickerMove {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .ts-ticker-track {
        animation: none !important;
    }

    .ts-ticker-window {
        overflow-x: auto;
    }

    .ts-ticker-group[aria-hidden="true"] {
        display: none;
    }
}


/* DYNAMIC HOME V1 - CAROUSEL */

.home-screen .ts-service-ticker {
    grid-column: 1 / -1;
}

.home-screen .ts-carousel {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    padding: 12px;
    background: rgba(17,28,46,.45);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.ts-carousel-title {
    margin: 0 0 12px;
    font-size: 16px;
    text-align: center;
    color: var(--text);
}

.ts-carousel-viewport {
    width: 100%;
    min-width: 0;
}

.ts-carousel-track {
    display: grid;
    gap: 12px;
}

.ts-carousel .service-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 220px;
    padding: 18px 16px;
    gap: 12px;
    text-align: center;
    border-radius: 14px;
}

.ts-carousel .service-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
    border-radius: 16px;
}

.ts-carousel .service-content {
    flex: 0 1 auto;
    width: 100%;
}

.ts-carousel .service-content h3 {
    font-size: 17px;
    margin-bottom: 6px;
}

.ts-carousel .service-content p {
    font-size: 12px;
    line-height: 1.8;
}

.ts-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 260px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(56,189,248,.09);
    color: var(--primary);
    font-size: 13px;
    font-weight: bold;
}

.ts-carousel .smm .ts-card-action {
    background: rgba(165,180,252,.09);
    color: var(--purple);
}

.ts-carousel .blog .ts-card-action {
    background: rgba(251,191,36,.09);
    color: var(--gold);
}

/* Enabled only after JavaScript initialization */

.ts-carousel.ts-carousel-ready
.ts-carousel-viewport {
    overflow: hidden;
    touch-action: pan-y;
    direction: ltr;
}

.ts-carousel.ts-carousel-ready
.ts-carousel-track {
    display: flex;
    gap: 0;
    direction: ltr;
    transition: transform .45s ease;
    will-change: transform;
}

.ts-carousel.ts-carousel-ready
.service-card {
    flex: 0 0 100%;
    direction: rtl;
    touch-action: pan-y;
}

.ts-carousel.ts-carousel-ready
.service-card:active {
    transform: none;
}

.ts-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.ts-carousel-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--primary);
}

.ts-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.ts-carousel-dots button {
    display: grid;
    place-items: center;
    min-width: 32px;
    min-height: 44px;
    padding: 0;
    background: transparent;
}

.ts-carousel-dots button::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 20px;
    background: var(--muted);
    transition: width .2s, background .2s;
}

.ts-carousel-dots
button[aria-current="true"]::before {
    width: 22px;
    background: var(--primary);
}

@media (min-width: 768px) {
    .ts-carousel .service-card {
        min-height: 240px;
    }
}

@media (max-width: 360px) {
    .home-screen .ts-carousel {
        padding: 9px;
    }

    .ts-carousel .service-card {
        padding: 14px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ts-carousel-track,
    .ts-carousel-dots button::before {
        transition: none !important;
    }
}

.ts-motion-paused .ts-carousel-track {
    transition: none;
}


/* DYNAMIC HOME V1 - MOTION STATE */

.ts-motion-suspended .ts-ticker-track {
    animation-play-state: paused;
}

.ts-motion-toggle:disabled {
    opacity: .6;
    cursor: default;
}

.ts-motion-paused .ts-ticker-window {
    overflow-x: auto;
}

.ts-motion-paused .ts-ticker-track {
    animation: none;
}

.ts-motion-paused
.ts-ticker-group[aria-hidden="true"] {
    display: none;
}

.ts-carousel .service-card:focus-visible {
    outline-offset: -4px;
}


/* PWA DYNAMIC HOME - COMPACT BRAND V1.1 */

.home-screen .brand-section {
    display: grid;
    grid-template-columns: 65px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 14px;
    row-gap: 3px;
    align-items: center;
    align-content: center;
    width: 100%;
    max-width: 380px;
    min-width: 0;
    margin: 0 auto 12px;
    padding: 8px 6px 12px;
    direction: rtl;
    text-align: center;
}

.home-screen .brand-section .main-logo {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 65px;
    height: 65px;
    max-width: 100%;
    object-fit: contain;
    margin: 0;
    align-self: center;
    justify-self: center;
}

.home-screen .brand-section h1 {
    grid-column: 2;
    grid-row: 1;
    font-size: 22px;
    line-height: 1.25;
    margin: 0;
    direction: ltr;
}

.home-screen .brand-section h2 {
    grid-column: 2;
    grid-row: 2;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.home-screen .brand-section p {
    grid-column: 2;
    grid-row: 3;
    font-size: 11px;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 360px) {

    .home-screen .brand-section {
        grid-template-columns: 58px minmax(0, 1fr);
        column-gap: 8px;
        padding: 6px 2px 10px;
        margin-bottom: 8px;
    }

    .home-screen .brand-section .main-logo {
        width: 58px;
        height: 58px;
    }

    .home-screen .brand-section h1 {
        font-size: 20px;
    }

    .home-screen .brand-section h2 {
        font-size: 14px;
    }

    .home-screen .brand-section p {
        font-size: 10px;
    }
}

@media (min-width: 768px) {

    .home-screen .brand-section {
        grid-template-columns: 80px minmax(0, 1fr);
        max-width: 420px;
        column-gap: 18px;
        padding: 12px 8px 16px;
    }

    .home-screen .brand-section .main-logo {
        width: 80px;
        height: 80px;
    }

    .home-screen .brand-section h1 {
        font-size: 26px;
    }

    .home-screen .brand-section h2 {
        font-size: 17px;
    }

    .home-screen .brand-section p {
        font-size: 12px;
    }
}
