/* Sha Tin Group — Mobile & tablet support */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

.shell {
    width: min(1180px, calc(100% - 32px));
}

/* ── Tablet / compact desktop: hamburger earlier ── */
@media (max-width: 1100px) {
    :root {
        --topbar: 72px;
        --topbar-social: 28px;
    }

    .topbar-row {
        gap: 12px;
    }

    .topbar .logo .logo-mark-img {
        height: 52px !important;
        max-width: 120px;
    }

    .topbar-cta .pill {
        padding: 10px 14px;
        font-size: 0.7rem;
    }

    .topbar-cta .lang-select {
        min-width: 60px;
        padding: 8px 28px 8px 10px;
        font-size: 0.7rem;
    }

    .lang-picker-btn {
        padding: 8px 10px;
        min-height: 40px;
        max-width: 96px;
        font-size: 0.68rem;
    }

    .lang-picker-panel {
        position: fixed;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: min(88vh, 720px);
        border-radius: 18px 18px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 320;
    }

    .lang-picker-backdrop {
        background: rgba(8, 10, 16, 0.55);
        z-index: 310;
    }

    .lang-picker-list {
        max-height: none;
        flex: 1 1 auto;
        min-height: 40vh;
    }

    .lang-picker-item {
        min-height: 52px;
        justify-content: center;
        padding: 12px 14px;
    }

    .lang-picker-search {
        min-height: 48px;
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .lang-mode-btn {
        min-height: 46px;
        font-size: 0.78rem;
    }

    .lang-picker-close {
        width: 40px;
        height: 40px;
    }

    body.lang-picker-open {
        overflow: hidden;
        touch-action: none;
    }

    .links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px 40px;
        gap: 0;
        margin-left: 0;
        background: rgba(11, 18, 32, 0.98);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(31, 122, 77, 0.28);
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s var(--ease), opacity 0.35s;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 210;
    }

    .links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .links > a,
    .links > .nav-dropdown > .nav-dropdown-trigger {
        width: 100%;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 0.9rem;
        letter-spacing: 0.06em;
    }

    .links .nav-dropdown {
        width: 100%;
    }

    .links .nav-dropdown-trigger {
        justify-content: space-between;
    }

    .links .nav-dropdown-menu,
    .links .nav-dropdown--wide .nav-dropdown-menu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        margin: 0 0 10px;
        padding: 10px;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        border: 1px solid transparent;
        background: linear-gradient(160deg, rgba(15, 107, 92, 0.22), rgba(255, 255, 255, 0.04));
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
    }

    .links .nav-dropdown.is-open .nav-dropdown-menu,
    .links .nav-dropdown.is-open .nav-dropdown--wide .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 1200px;
        border-color: rgba(63, 168, 153, 0.35);
        padding: 12px;
    }

    .links .nav-dropdown.is-open .nav-dropdown-trigger::after {
        transform: rotate(225deg) translateY(-2px);
    }

    .links .nav-dropdown-menu a {
        padding: 10px 12px;
        border-bottom: 0;
    }

    .topbar-cta .link-quiet { display: none; }
    .topbar-cta .cta-dropdown-menu {
        min-width: min(240px, calc(100vw - 32px));
    }
    .burger { display: flex; margin-left: 0; }

    body.nav-open {
        overflow: hidden;
    }
}

/* ── Phones ── */
@media (max-width: 767px) {
    :root {
        --topbar: 64px;
        --topbar-social: 26px;
        --shell: min(100% - 28px, 1180px);
        --section-pad: 56px;
    }

    .shell {
        width: min(1180px, calc(100% - 28px));
    }

    .topbar-trust {
        font-size: 0.55rem;
        letter-spacing: 0.06em;
        max-width: 55%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-social {
        gap: 10px;
    }

    .topbar-social a {
        font-size: 0.68rem;
    }

    .topbar .logo .logo-mark-img {
        height: 44px !important;
        max-width: 100px;
    }

    .topbar-cta {
        gap: 6px;
    }

    .topbar-cta .cta-dropdown--signin .cta-dropdown-trigger {
        padding: 9px 10px;
        font-size: 0.65rem;
    }

    .topbar-cta .cta-dropdown--apply .cta-dropdown-trigger {
        padding: 9px 12px;
        font-size: 0.65rem;
    }

    .topbar-cta .lang-select {
        min-width: 52px;
        padding: 7px 26px 7px 8px;
    }

    .lang-picker-btn {
        max-width: 72px;
        padding: 7px 6px;
        gap: 4px;
    }

    .lang-picker-ico svg {
        width: 12px;
        height: 12px;
    }

    /* Hero */
    .hero-carousel {
        min-height: 100svh;
        min-height: 100vh;
    }

    .hero-carousel .hero-overlay {
        padding: calc(var(--header-height) + 28px) 0 88px;
    }

    .hero-carousel .slide-content {
        max-width: 100%;
    }

    .hero-carousel .slide-content h2,
    .hero-carousel .slide-content h2 {
        font-size: clamp(2rem, 9vw, 2.75rem);
        margin-bottom: 14px;
    }

    .hero-brand {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }

    .hero-carousel .slide-content > p {
        font-size: 0.95rem;
        margin-bottom: 22px;
        max-width: 100%;
    }

    .hero-btns {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-btns .pill {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .hero-carousel .slide-dots {
        bottom: 20px;
        left: 16px;
        right: 16px;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .block {
        padding: 56px 0;
    }

    .block-head {
        margin-bottom: 28px;
    }

    .block-head h2,
    .split-copy h2,
    .reach-grid h2,
    .home-section-intro h2 {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
    }

    .split,
    .reach-grid,
    .expo-job-grid,
    .chairman-grid,
    .portal-promo-inner,
    .content-body .content-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .steps,
    .offer-grid,
    .fee-strip,
    .security-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .chairman-box {
        padding: 24px 18px;
    }

    .chairman-grid > div:first-child {
        max-width: 280px;
        margin: 0 auto;
    }

    .pill,
    .btn {
        min-height: 44px;
    }

    .page-hero {
        height: 200px !important;
    }

    .content-body {
        padding: 40px 0 56px;
    }

    .login-page {
        padding: calc(var(--header-height) + 24px) 16px 48px;
    }

    .login-card {
        padding: 28px 20px;
        width: 100%;
    }

    .ticker {
        padding: 10px 0;
    }

    .ticker-track span {
        font-size: 0.65rem;
        letter-spacing: 0.12em;
    }

    .calc-panel,
    .care-panel,
    .testimonials-panel {
        border-radius: 8px;
    }

    .calc-panel-form,
    .calc-panel-output,
    .care-panel-content {
        padding: 20px 16px;
    }

    .expo-job-card {
        padding: 24px 18px;
    }

    .reach-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .portal-floating-badge {
        position: static;
        margin-top: 12px;
        display: inline-flex;
    }

    .portal-mockup {
        padding: 0;
    }

    .frame img {
        aspect-ratio: 16 / 10;
    }

    /* Prevent fixed elements from causing horizontal scroll */
    .aurora,
    .partners-section,
    .ticker {
        max-width: 100vw;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .topbar-social-bar {
        display: none;
    }

    :root {
        --topbar-social: 0px;
        --topbar: 60px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .service-card,
    .security-badge {
        padding: 22px 18px;
    }

    .hero-carousel .slide-content h2 {
        font-size: 1.85rem;
        line-height: 1.12;
    }

    .cta-band {
        padding: 36px 18px;
    }
}

/* ── Forms — mobile-friendly site-wide ── */
@media (max-width: 767px) {
    .form-row,
    .expo-form-row,
    .contact-form-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .form-row > .form-group,
    .expo-form-row > .expo-form-group,
    .contact-form-grid > .form-group {
        width: 100%;
        min-width: 0;
    }

    .form-group,
    .expo-form-group,
    .calc-field {
        margin-bottom: 16px;
    }

    .form-group label,
    .expo-form-group label,
    .calc-field label,
    .login-card .form-group label,
    .dashboard-main .form-group label,
    .modal .form-group label {
        font-size: 0.75rem;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .form-control,
    .calc-field input,
    .expo-form-group .form-control,
    .phone-field .phone-code,
    .phone-field .phone-local,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important; /* prevents iOS zoom on focus */
        min-height: 48px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    textarea,
    textarea.form-control {
        min-height: 140px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    select.form-control,
    .phone-field .phone-code,
    .country-select,
    .lang-select {
        padding-right: 36px;
        background-position: right 12px center;
    }

    .phone-field {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .phone-field .phone-code {
        width: 100%;
    }

    /* Buttons under forms — full-width, stack */
    form .btn,
    form .pill,
    .form-actions .btn,
    .form-actions .pill,
    .login-card .pill,
    .login-card .btn,
    .contact-form-wrap .pill,
    .contact-form-wrap .btn,
    .expo-form-card .btn,
    .expo-form-card .pill,
    .card form .btn,
    .card form .pill,
    .modal form .btn {
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-height: 48px;
    }

    .form-actions,
    .card form > .btn + .btn,
    .card form > .btn + a.btn,
    .card form > a.btn {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    /* Inline back/continue pairs often use margin-left */
    .card form a.btn-dark,
    .card form button + a.btn,
    .card form .btn + .btn-dark {
        display: flex;
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
        justify-content: center;
        align-items: center;
        min-height: 48px;
    }

    .login-page {
        padding: calc(var(--header-height) + 20px) 14px 40px;
        align-items: flex-start;
    }

    .login-card {
        padding: 24px 16px;
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }

    .login-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .login-tabs button {
        min-height: 44px;
        font-size: 0.8rem;
        padding: 10px 8px;
    }

    .login-logo img {
        max-width: 200px;
        max-height: 72px;
    }

    .login-logo h1 {
        font-size: 1.45rem;
    }

    .contact-form-wrap {
        padding: 0;
    }

    .contact-form-wrap h3 {
        font-size: 1.35rem;
    }

    .map-container iframe {
        width: 100%;
        min-height: 220px;
        border: 0;
    }

    .expo-form-card {
        padding: 22px 16px;
        border-radius: 14px;
        margin: 0 4px;
    }

    .expo-form-card h3 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }

    .expo-stage-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 8px;
        justify-content: flex-start;
    }

    .expo-stage-dot {
        flex: 0 0 auto;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .expo-yesno {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .expo-payment-methods {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-main {
        padding: 14px !important;
    }

    .dashboard-main > .card,
    .dashboard-layout .card {
        padding: 18px 14px;
        border-radius: 10px;
        overflow: hidden;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .dashboard-header h1 {
        font-size: 1.4rem;
    }

    .dashboard-header .user-info {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .stage-progress {
        gap: 4px;
        margin-bottom: 24px;
        padding-bottom: 6px;
    }

    .stage-step .step-circle {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }

    .stage-step .step-label {
        font-size: 0.58rem;
        max-width: 56px;
        line-height: 1.25;
    }

    .doc-upload-zone {
        padding: 20px 14px;
    }

    .profile-upload {
        margin: 0 auto;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal,
    .modal-overlay .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 16px;
        border-radius: 14px 14px 0 0;
        margin: 0;
    }

    .modal .form-row {
        grid-template-columns: 1fr !important;
    }

    .table-responsive,
    .card.table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Checkbox / radio rows */
    .form-group label:has(input[type="checkbox"]),
    .form-group label:has(input[type="radio"]),
    .expo-form-group label:has(input[type="checkbox"]),
    .expo-form-group label:has(input[type="radio"]) {
        min-height: 44px;
        padding: 8px 0;
        align-items: flex-start;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        min-height: 20px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    /* Date inputs can overflow on some Android browsers */
    input[type="date"].form-control {
        min-width: 0;
    }

    /* Registration pages without sidebar */
    .dashboard-layout > .dashboard-main[style] {
        padding-left: 14px !important;
        padding-right: 14px !important;
        padding-top: 24px !important;
    }
}

@media (max-width: 480px) {
    .expo-payment-methods {
        grid-template-columns: 1fr;
    }

    .widget-grid {
        grid-template-columns: 1fr !important;
    }

    .login-card,
    .expo-form-card,
    .dashboard-main > .card {
        padding: 18px 12px;
    }

    .stage-step .step-label {
        display: none;
    }

    .stage-progress::before {
        top: 17px;
    }
}
