/* ====================================================================
   Home Buyers Guide SA — Premium Modal & Upgrade Strip Styles
   Matches the app's navy / teal dark theme
   ==================================================================== */

/* ====================================================================
   MODAL OVERLAY + BOTTOM SHEET
   ==================================================================== */
.premium-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;        /* bottom-sheet anchors to bottom */
    justify-content: center;
    background: rgba(0,0,0,0);
    pointer-events: none;
    transition: background 0.3s ease;
}
.premium-modal.show {
    background: rgba(0,0,0,0.72);
    pointer-events: all;
}
.premium-modal.hidden {
    visibility: hidden;
}
.premium-modal.show .pm-sheet {
    transform: translateY(0);
}

/* Tap-outside backdrop */
.pm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
}

/* The sliding card */
.pm-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    background: #0d1520;
    border-top: 0.5px solid #1e3448;
    border-radius: 24px 24px 0 0;
    padding: 8px 20px 36px;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    /* scrollbar hidden */
    scrollbar-width: none;
}
.pm-sheet::-webkit-scrollbar { display: none; }

/* Drag handle */
.pm-drag-handle {
    width: 40px;
    height: 4px;
    background: #1e3448;
    border-radius: 2px;
    margin: 8px auto 20px;
}

/* Close button */
.pm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 0.5px solid #1e3448;
    color: #8bbad4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.pm-close:hover { background: rgba(255,255,255,0.12); }

/* ====================================================================
   BRANDING HEADER
   ==================================================================== */
.pm-brand {
    text-align: center;
    padding: 10px 0 20px;
}
.pm-crown-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6,214,160,0.18), rgba(6,214,160,0.06));
    border: 1px solid rgba(6,214,160,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 24px;
    color: #06D6A0;
}
.pm-heading {
    font-size: 18px;
    font-weight: 700;
    color: #e8f1f8;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}
.pm-subheading {
    font-size: 13px;
    color: #8bbad4;
    margin: 0;
}

/* ====================================================================
   BENEFITS — clean bullet list
   ==================================================================== */
.pm-benefits {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pm-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #c5dde8;
    line-height: 1.45;
}
.pm-benefits li i {
    color: #06D6A0;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}
.pm-benefits li strong {
    color: #e8f1f8;
    font-weight: 600;
}

/* ====================================================================
   PRICING PLANS — vertical row layout (4 plans)
   ==================================================================== */
.pm-plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 20px;
}

/* Base plan row */
.pm-plan-row {
    background: #132030;
    border: 1px solid #1e3448;
    border-radius: 14px;
    padding: 13px 14px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pm-plan-row:active { background: #162436; }

/* Featured row — 6 Months */
.pm-plan-row-featured {
    background: linear-gradient(135deg, #0d2438, #0b1e30);
    border-color: rgba(6,214,160,0.55);
    border-width: 1.5px;
}
.pm-plan-row-featured:active { background: linear-gradient(135deg, #112a40, #0f2438); }

/* Annual row */
.pm-plan-row-annual {
    border-color: rgba(244,162,97,0.3);
}
.pm-plan-row-annual:active { background: #16202e; }

/* Plan label & period */
.pm-plan-info {
    flex: 1;
    min-width: 0;
}
.pm-plan-label {
    font-size: 13px;
    font-weight: 700;
    color: #e8f1f8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}
.pm-plan-row-featured .pm-plan-label { color: #06D6A0; }

.pm-plan-period {
    font-size: 11px;
    color: #5a85a0;
    margin-top: 2px;
}
.pm-plan-row-featured .pm-plan-period { color: #7ab8d0; }

/* Price block */
.pm-plan-pricing {
    text-align: right;
    flex-shrink: 0;
}
.pm-plan-price {
    font-size: 20px;
    font-weight: 800;
    color: #e8f1f8;
    letter-spacing: -0.5px;
    line-height: 1;
}
.pm-plan-row-featured .pm-plan-price { color: #06D6A0; }

/* Save badge */
.pm-plan-save {
    font-size: 10px;
    font-weight: 700;
    color: #06D6A0;
    background: rgba(6,214,160,0.12);
    border-radius: 10px;
    padding: 2px 7px;
    display: inline-block;
    margin-top: 3px;
}
.pm-plan-save-gold {
    color: #F4A261;
    background: rgba(244,162,97,0.12);
}

/* Inline best-value tag on Annual plan label */
.pm-best-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #F4A261;
    background: rgba(244,162,97,0.12);
    border: 0.5px solid rgba(244,162,97,0.3);
    border-radius: 10px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* Most-popular corner ribbon on featured row */
.pm-featured-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: #0d1520;
    background: #06D6A0;
    padding: 3px 10px;
    border-bottom-left-radius: 8px;
}

/* Subscribe buttons */
.pm-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 8px;
    border: 0.5px solid #1e3448;
    background: rgba(255,255,255,0.05);
    color: #8bbad4;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    margin-top: 0;
}
.pm-btn:active { background: rgba(255,255,255,0.1); }

.pm-btn-featured {
    background: #06D6A0;
    border-color: #06D6A0;
    color: #0d1520;
}
.pm-btn-featured:active { background: #05bf8e; }

/* ====================================================================
   MONTHLY TRIAL ROW
   ==================================================================== */
/* Monthly trial plan row — teal glow (distinct from featured 6-months) */
.pm-plan-row-trial {
    background: linear-gradient(135deg, #091d2c, #071520);
    border-color: rgba(6,214,160,0.45);
    border-width: 1.5px;
}
.pm-plan-row-trial:active { background: linear-gradient(135deg, #0d2438, #0b1a28); }

/* Corner ribbon — top-left */
.pm-trial-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #0d1520;
    background: linear-gradient(90deg, #06D6A0, #00D4E4);
    padding: 3px 10px;
    border-bottom-right-radius: 8px;
}

/* FREE price text */
.pm-plan-price-free {
    color: #06D6A0;
    font-size: 22px;
}

/* 'then R80/mo' subtext */
.pm-trial-then {
    font-size: 11px;
    color: #7ab8d0;
    margin-top: 2px;
}

/* Trial subscribe button */
.pm-btn-trial {
    background: linear-gradient(135deg, #06D6A0, #00D4E4);
    border-color: transparent;
    color: #0d1520;
    font-weight: 700;
}
.pm-btn-trial:active { background: #05bf8e; border-color: transparent; }

/* ====================================================================
   PROMO / VOUCHER CODE ROW
   ==================================================================== */
.pm-voucher-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: rgba(6,214,160,0.05);
    border: 0.5px solid rgba(6,214,160,0.18);
    border-radius: 12px;
    margin: 0 0 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
}
.pm-voucher-row:active { background: rgba(6,214,160,0.1); }
.pm-voucher-row > i {
    color: #06D6A0;
    font-size: 16px;
    flex-shrink: 0;
}
.pm-voucher-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.pm-voucher-label {
    font-size: 13px;
    font-weight: 600;
    color: #c5dde8;
}
.pm-voucher-sub {
    font-size: 11px;
    color: #5a85a0;
}
.pm-voucher-btn {
    background: transparent;
    border: 0.5px solid rgba(6,214,160,0.35);
    border-radius: 8px;
    color: #06D6A0;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.pm-voucher-btn:active { background: rgba(6,214,160,0.12); }
.pm-voucher-btn i { font-size: 9px; }

/* ====================================================================
   LEGAL FOOTER
   ==================================================================== */
.pm-legal {
    font-size: 10px;
    color: #3d5e72;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    padding: 0 10px;
}

/* ====================================================================
   SIMPLE UTILITY MODAL (errors / messages)
   ==================================================================== */
.pm-simple-card {
    position: relative;
    z-index: 1;
    background: #132030;
    border: 0.5px solid #1e3448;
    border-radius: 18px;
    padding: 28px 24px;
    width: calc(100% - 40px);
    max-width: 360px;
    text-align: center;
    margin: auto;
}
.pm-simple-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #e8f1f8;
    margin: 0 0 12px;
}
.pm-simple-card p {
    font-size: 13px;
    color: #8bbad4;
    margin: 0 0 20px;
    line-height: 1.5;
}
/* Align backdrop/card for centered modal */
.pm-simple-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
}

/* ====================================================================
   PREMIUM WELCOME (auto-close after 3s)
   ==================================================================== */
.pm-welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    padding: 20px;
    animation: pmFadeIn 0.3s ease;
}
.pm-welcome-fade { animation: pmFadeOut 0.4s ease forwards; }

@keyframes pmFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pmFadeOut { from { opacity: 1; } to { opacity: 0; } }

.pm-welcome-inner {
    background: #132030;
    border: 1px solid rgba(6,214,160,0.3);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
}
.pm-welcome-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(6,214,160,0.15);
    border: 1px solid rgba(6,214,160,0.4);
    color: #06D6A0;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}
.pm-welcome-inner h2 {
    font-size: 22px;
    font-weight: 800;
    color: #e8f1f8;
    margin: 0 0 8px;
}
.pm-welcome-inner p {
    font-size: 13px;
    color: #8bbad4;
    margin: 0 0 18px;
    line-height: 1.5;
}
.pm-welcome-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.pm-welcome-checks span {
    font-size: 13px;
    color: #06D6A0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ====================================================================
   UPGRADE STRIP — shown in-app for free users
   ==================================================================== */
.upgrade-strip {
    position: fixed;
    /* Banner ad removed entirely — strip now sits directly and consistently
       above bottom-nav, no conditional offset needed for any ad state. */
    bottom: calc(51px + max(10px, env(safe-area-inset-bottom, 10px)));
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #0d1520;
    border-top: 1px solid rgba(6,214,160,0.22);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.35);
}

.us-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.us-left > .fas {
    color: #06D6A0;
    font-size: 16px;
    flex-shrink: 0;
}
.us-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.us-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #e8f1f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.us-text span {
    font-size: 11px;
    color: #8bbad4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.us-btn {
    flex-shrink: 0;
    background: #06D6A0;
    color: #0d1520;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.2s;
}
.us-btn:active { background: #05bf8e; }
.us-btn .fas { font-size: 10px; }

/* Extra bottom padding so the last card in view isn't hidden behind the
   strip. Uses !important to win over theme.css's .screen padding-bottom. */
body:not(.premium-user) .screen {
    padding-bottom: calc(51px + max(10px, env(safe-area-inset-bottom, 10px)) + 56px) !important;
}

/* ====================================================================
   LOCKED PROPERTY CARDS (free user, property index >= 2)
   ==================================================================== */
.property-locked {
    opacity: 0.6;
}
.property-lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(244,162,97,0.18);
    border: 0.5px solid rgba(244,162,97,0.5);
    border-radius: 20px;
    color: #F4A261;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    z-index: 2;
}

/* ====================================================================
   SHEET ANIMATION
   ==================================================================== */
@keyframes pmSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}