/* ------------------------------------------------------------------------------
   User portal polish (member app only - not loaded by the dashboard)
   Loaded last by app/layout and app/home/layout, so it only refines what pages
   already define: softer cards, consistent radius, bigger tap targets, and a
   mobile-first bottom menu. Remove the <link> in the two layouts to undo.
-------------------------------------------------------------------------------*/

:root {
    --wk-radius: 14px;
    --wk-radius-sm: 12px;
    --wk-shadow: 0 2px 12px rgba(17, 24, 39, 0.06);
    --wk-border: #edf1f0;
    --wk-focus: 0 0 0 3px rgba(47, 212, 184, 0.22);
}

html {
    -webkit-text-size-adjust: 100%;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* Buttons ---------------------------------------------------------------------*/
.btn {
    border-radius: var(--wk-radius-sm);
    transition: transform .1s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active {
    transform: scale(0.98);
}
.btn:focus,
.btn.focus {
    box-shadow: var(--wk-focus);
}
.btn-primary:not(:disabled):not(.disabled) {
    box-shadow: 0 4px 12px rgba(47, 212, 184, 0.22);
}
.btn-default {
    border: 1px solid #e3e7ea;
    background: #fff;
}

/* Form fields -----------------------------------------------------------------*/
.form-control {
    border-radius: var(--wk-radius-sm);
    border-color: #e3e7ea;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    border-color: var(--primary-theme-color);
    box-shadow: var(--wk-focus);
}
.form-check-input {
    accent-color: var(--highlight-theme-color);
}

/* Cards, alerts, modals -------------------------------------------------------*/
.alert {
    border: none;
    border-radius: var(--wk-radius);
    font-size: var(--label-font-size);
    line-height: 1.6;
}
.alert-danger {
    background: #fff1f1;
    color: #8f2424;
    border-left: 4px solid #e05a5a;
}
.alert-danger a {
    color: #b42318;
    font-weight: 700;
    text-decoration: underline;
}
.modal-content {
    border: none;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, 0.18);
    overflow: hidden;
}
.dropdown-menu {
    border: 1px solid var(--wk-border);
    border-radius: var(--wk-radius-sm);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.10);
}

/* Avatars: brand colours instead of random dark colours */
.profile-icon {
    background: linear-gradient(135deg, var(--primary-theme-color) 0%, var(--highlight-theme-color) 100%) !important;
    box-shadow: 0 4px 12px rgba(5, 136, 125, 0.18);
}
.profile-icon h1 {
    color: #fff;
    font-weight: 700;
}

/* Home: member list ------------------------------------------------------------*/
.sharer-item {
    border-radius: 16px;
    border: 1px solid var(--wk-border);
    box-shadow: var(--wk-shadow);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .1s ease;
}
.sharer-item:active {
    transform: scale(0.99);
}
.sharer-item .profile-icon {
    width: 44px;
    height: 44px;
    margin-right: 1em;
}
.sharer-item .badge {
    top: 1em;
    right: 1em;
    padding: 4px 8px;
    border-radius: 50px;
    font-size: 0.55em;
    font-weight: 700;
}
.suspended-alert,
.terminated-alert,
.probation-alert {
    border-radius: 0;
}
.suspended-alert .btn-primary,
.suspended-alert .btn-default,
.terminated-alert button {
    border-radius: 10px;
}

/* Home: stat boxes */
.app-banner-box {
    border-radius: 16px;
}

/* Settings menu list */
.account-menu-item {
    border-radius: var(--wk-radius-sm);
}

/* Mobile ---------------------------------------------------------------------*/
@media screen and (max-width: 767px) {

    /* 16px inputs stop iOS from zooming in on focus */
    input.form-control,
    select.form-control,
    textarea.form-control {
        font-size: 16px;
    }
    .form-control:not(textarea) {
        min-height: 46px;
    }
    .btn {
        min-height: 40px;
    }

    /* Keep the last item clear of the fixed bottom menu */
    .app-screen {
        padding-bottom: calc(112px + env(safe-area-inset-bottom));
    }

    /* Bottom menu: frosted bar with a soft top shadow and iPhone home-bar space */
    .app-menu-program,
    #app-menu {
        height: calc(76px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        box-shadow: 0 -6px 24px rgba(17, 24, 39, 0.06);
    }
    .app-menu-program:before,
    div#app-menu:before {
        display: none;
    }

    /* Home stats (WeShare home only): compact grid instead of four tall blocks */
    .app-banner.col-md-5 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .app-banner.col-md-5 > .app-banner-box {
        margin-bottom: 0;
        padding: 1em 1.2em;
    }
    .app-banner.col-md-5 > .app-banner-box:nth-child(1),
    .app-banner.col-md-5 > .app-banner-box:nth-child(2) {
        grid-column: 1 / -1;
    }
    .app-banner.col-md-5 > .app-banner-box:nth-child(n+3) h3 {
        font-size: 0.95em;
    }

    /* Modals sit closer to the edges on small screens */
    .modal-dialog {
        margin: 0.75rem;
    }
}

/* ==============================================================================
   Step-by-step screens: login, register, forgot password, add member,
   health questions, payment. Restyles the shared parts these pages already
   use (.progress-bar-box, .back-btn, .input-box, *-header) - no new markup needed.
==============================================================================*/

/* Progress: dots become a segmented bar (changeStep() still sets active/completed) */
.progress-bar-box {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto 2em;
    padding: 0;
}
.progress-bar-box:before {
    display: none;
}
.progress-bar-box .dot {
    flex: 1;
    width: auto;
    height: 6px;
    border-radius: 6px;
    background: #e7edeb;
    border: none !important;
    transition: background .3s ease;
}
.progress-bar-box .dot:after {
    display: none;
}
.progress-bar-box .dot.completed {
    background: var(--primary-theme-color);
}
.progress-bar-box .dot.active {
    background: linear-gradient(90deg, var(--primary-theme-color) 0%, #9be9da 100%);
}

/* Back button: a soft round icon button */
.back-btn {
    width: 40px;
    line-height: 40px;
    text-align: center;
    height: 40px;
    border-radius: 12px;
    background: #f2f6f5;
    margin-bottom: 1.2em;
    transition: background .15s ease;
}
.back-btn:hover {
    background: var(--secondary-theme-color);
}
.back-btn img {
    width: 16px;
    margin: 0;
    vertical-align: middle;
}

/* Titles */
.login-header h4,
.register-header h4,
.sharer-header h4,
.medical-header h4,
.forgot-header h4 {
    font-size: 1.7em;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 0.35em;
}
.login-header p,
.register-header p,
.sharer-header p,
.medical-header p,
.forgot-header p {
    font-size: 0.9em;
    color: #6b7280;
    opacity: 1;
    line-height: 1.55;
}
.flow-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--highlight-theme-color);
    background: var(--secondary-theme-color);
    padding: 4px 10px;
    border-radius: 50px;
    margin-bottom: 0.8em;
}

/* Floating-label fields */
.input-box {
    margin-bottom: 18px;
}
.input-box .input-1 {
    height: 54px;
    border-radius: 14px;
    border: 1.5px solid #e3e8e6;
    background-color: #fff;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--default-font-color);
}
.input-box .input-1:focus {
    border: 1.5px solid var(--primary-theme-color);
    box-shadow: var(--wk-focus);
}
.input-box .input-label {
    top: 16px;
    left: 10px;
    color: #8a949c;
}
.input-box.focus .input-label,
.input-box.active .input-label,
.input-box.error .input-label {
    top: -9px;
    font-weight: 600;
}
.input-box.active .input-1 {
    border: 1.5px solid var(--primary-theme-color);
}
.input-box.error .input-1 {
    border: 1.5px solid #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.12);
}
select.input-1 {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px !important;
}

/* +60 phone prefix sits inside the field */
.tel-box {
    margin-left: 0 !important;
}
.tel-box::before {
    left: 0;
    width: 58px;
    z-index: 1;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    border-right: 1.5px solid #e3e8e6;
    margin: 12px 0;
}
.tel-box .input-1 {
    padding-left: 72px;
}
.tel-box .input-label {
    left: 66px;
}
.tel-box.focus .input-label,
.tel-box.active .input-label {
    left: 10px;
}

/* Main actions on these screens */
.login-screen .btn,
.register-content .btn,
.sharer-content .btn,
.medical-content .btn,
.forgot-content .btn,
.payment-details .btn {
    min-height: 52px;
    border-radius: 14px;
    font-size: 15px;
}
.register-content .btn-secondary {
    background: #fff !important;
    border: 1.5px solid #e3e8e6 !important;
    color: var(--highlight-theme-color) !important;
    box-shadow: none;
}
.forgot-section a {
    color: var(--highlight-theme-color) !important;
}

/* Login */
.login-header .flow-eyebrow {
    margin-top: 1em;
}

/* Register: referrer chip */
.ref-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--highlight-theme-color);
    background: var(--secondary-theme-color);
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
}
.ref-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 100%;
    background: linear-gradient(135deg, var(--primary-theme-color), var(--highlight-theme-color));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.ref-title b {
    font-weight: 700;
}

/* Add member: helper text under a field */
.field-hint {
    display: block;
    margin: -10px 0 16px 4px;
    font-size: 12px;
    color: #8a949c;
}
.sharer-content .alert-info {
    background: var(--secondary-theme-color);
    color: var(--highlight-theme-color);
    border-left: 4px solid var(--primary-theme-color);
}

/* Health questions: Yes / No side by side */
.yes-no-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.yes-no-section .btn {
    margin-top: 0.5em !important;
}
.yes-no-section .small-section {
    grid-column: 1 / -1;
}
.yes-no-section .btn-secondary {
    background: #fff !important;
    border: 1.5px solid #e3e8e6 !important;
    color: var(--default-font-color) !important;
}
.change-language {
    height: 36px;
    border-radius: 10px !important;
    background-color: #fff;
}

/* WeShare payment: plan cards */
.payment-package .card {
    border-radius: 14px !important;
    border: 1.5px solid #e6ebe9 !important;
    border-top-width: 5px !important;
}
.payment-package .card.selected-option {
    border-color: var(--primary-theme-color) !important;
    box-shadow: 0 8px 20px rgba(47, 212, 184, 0.16) !important;
}
#voucherCode {
    min-height: 50px;
    border-radius: 14px;
}

/* OTP circles keep their own size */
#otp .form-control {
    min-height: 0;
    border-radius: 100% !important;
}

@media screen and (max-width: 767px) {

    .back-btn {
        display: inline-block;
    }

    .login-header,
    .register-header,
    .sharer-header,
    .medical-header,
    .forgot-header {
        text-align: left;
        margin-bottom: 1.8em;
    }
    .register-header img,
    .medical-header img {
        display: block;
        height: 120px;
        width: auto;
        margin: 0.5em auto 0;
    }

    /* Login: smaller picture on a soft circle, form below */
    .login-screen {
        justify-content: flex-start;
        margin-top: 0;
        min-height: auto;
        padding-top: 1.5em;
    }
    .login-header img.login-vector {
        width: 190px;
        height: 190px;
        object-fit: contain;
        padding: 18px;
        border-radius: 100%;
        background: radial-gradient(circle, var(--secondary-theme-color) 0%, #ffffff 72%);
        display: block;
        margin: 0 auto 0.5em;
    }
    .login-header p {
        margin-bottom: 2em;
    }

    /* Register: referrer chip on its own line */
    .ref-title {
        position: static;
        margin: 0 0 1.2em;
    }

    /* Payment: plan cards become compact rows instead of tall boxes */
    .payment-package .col-md-4 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .payment-package .card {
        height: auto !important;
        min-height: 72px;
        transform: none !important;
        opacity: 1 !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 14px 48px !important;
        margin-bottom: 10px;
    }
    .payment-package .card:before {
        content: '';
        position: absolute;
        left: 16px;
        top: 50%;
        width: 20px;
        height: 20px;
        margin-top: -10px;
        border-radius: 100%;
        border: 2px solid #d1d5db;
        background: #fff;
    }
    .payment-package .card.selected-option:before {
        border-color: var(--primary-theme-color);
        background: var(--primary-theme-color);
        box-shadow: inset 0 0 0 4px #fff;
    }
    .payment-package .card .text-center {
        margin-top: 0 !important;
        text-align: left !important;
    }
    .payment-package .card .text-center .badge {
        margin-top: 4px;
    }
    .payment-package .card .promotion-label,
    .payment-package .card .promotion-label-highlight {
        position: static;
        margin: 0;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media screen and (min-width: 768px) {
    .progress-bar-box {
        width: 220px;
    }
    .back-btn {
        margin-bottom: 0;
    }
}

/* ==============================================================================
   WeShare home
==============================================================================*/
.app-header-title p {
    font-size: 0.85em;
    color: #6b7280;
    opacity: 1;
    margin-bottom: 0;
}
.app-header-title h4 {
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.app-header .profile-icon {
    width: 42px;
    height: 42px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(47, 212, 184, 0.18), 0 6px 14px rgba(17, 24, 39, 0.10);
}
.swiper-slide img {
    border-radius: 16px;
}
.app-sharer-list-header .ttt {
    font-size: 1.05em;
}
.app-sharer-list-header .add-btn {
    box-shadow: 0 6px 14px rgba(47, 212, 184, 0.30);
}
.sharer-content .sharer-name {
    font-size: 0.95em !important;
    font-weight: 700;
    color: var(--default-font-color);
    margin-bottom: 4px;
    padding-right: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sharer-content .sharer-nric {
    font-weight: 400 !important;
    color: #6b7280;
}
.sharer-content .sharer-nric span {
    opacity: 1;
}
.app-banner-box h3 span {
    font-size: 1.15em;
}

/* ==============================================================================
   Settings (WeShare and WeCare share this page)
==============================================================================*/
.account-header {
    padding: 1.6em 1em 1.2em;
    border-radius: 20px;
    background: linear-gradient(160deg, var(--secondary-theme-color) 0%, #f7fdfc 60%, #ffffff 100%);
    border: 1px solid #e3f3f0;
    margin-bottom: 1em;
}
.account-header .profile-icon {
    width: 76px;
    height: 76px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(47, 212, 184, 0.16), 0 8px 18px rgba(5, 136, 125, 0.18);
}
.account-header .profile-icon h1 {
    font-size: 2em;
}
.account-header p {
    color: #6b7280;
    opacity: 1;
    margin-bottom: 0;
}
.account-data-item .data-item-box {
    border-radius: 16px;
    padding: 1em 1.1em;
}
.account-data-item.active .data-item-box {
    background: linear-gradient(135deg, var(--primary-theme-color) 0%, var(--highlight-theme-color) 100%);
    box-shadow: 0 8px 18px rgba(5, 136, 125, 0.18);
}
.data-item-box p {
    font-size: 0.72em;
    opacity: 0.85;
}
.data-item-box h2 {
    font-size: 1.6em;
}
.account-menu-section .menu-h {
    display: none;
}
.account-menu-section {
    margin-top: 1.4em;
    padding: 6px 0;
    border: 1px solid var(--wk-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--wk-shadow);
}
.account-menu-item {
    margin: 0;
    padding: 12px 16px;
    border-radius: 0;
    color: var(--default-font-color) !important;
    cursor: pointer;
}
.account-menu-item + .account-menu-item,
.agent-menu-item + .account-menu-item {
    border-top: 1px solid #f1f4f3;
}
.account-menu-item .menu-icon div {
    margin-right: 1em;
    border-radius: 12px;
    font-size: 0.9em;
}
.account-menu-item .menu-icon p {
    font-weight: 600;
    font-size: 0.95em;
}
.account-menu-item > .ti-angle-right {
    font-size: 0.8em;
    color: #9ca3af;
}
.account-menu-item.highlight .menu-icon div {
    background: #fff1f1;
    color: #c0392b;
}
.account-menu-item.highlight .menu-icon p {
    color: #c0392b;
}
.agent-menu-item {
    margin-left: 0;
    padding: 0 16px 8px 72px;
}
.agent-menu-item a {
    padding: 8px 0;
    margin: 0;
    color: var(--default-font-color) !important;
    font-size: 0.9em;
    border-bottom: 1px dashed #eef1f0;
}
/* the header and menu are bootstrap columns: keep their cards inside the gutter */
.account-content > .account-header,
.account-content > .account-menu-section {
    flex: 0 0 calc(100% - 30px);
    max-width: calc(100% - 30px);
    margin-left: 15px;
    margin-right: 15px;
}
