.webapp-page {
    text-align: center;
}

/* Webapp Hero Heading Style */
.webapp-hero {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4vw, 3rem);
    color: var(--ink);
    text-align: center;
    margin: 0 0 1.5rem;
    letter-spacing: 0.3px;
}

/* Buttons & Inputs scoped to the mobile demo */
.mobile-container .btn-primary,
.mobile-container .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mobile-container .btn-primary {
    background: linear-gradient(135deg, #4a7a5a, #3a5a40); /* Sage green gradient */
    color: #fff;
    border: none;
    box-shadow: 0 10px 20px rgba(58, 90, 64, 0.25);
}

.mobile-container .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(58, 90, 64, 0.35);
}

.mobile-container .btn-secondary {
    background: #fff;
    color: #4a7a5a;
    border: 1px solid rgba(74, 122, 90, 0.3);
    box-shadow: 0 6px 14px rgba(42, 61, 52, 0.08);
}

.mobile-container .btn-secondary:hover {
    background: rgba(74, 122, 90, 0.08);
}

.mobile-container .btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: #e8f0eb; /* Light sage green */
    color: #3a5a40;
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(58, 90, 64, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-container .btn-back:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(58, 90, 64, 0.25);
}

.mobile-container .pill {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(74, 122, 90, 0.35);
    background: #fff;
    color: #4a7a5a;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-container .pill:hover {
    background: rgba(74, 122, 90, 0.1);
    box-shadow: 0 8px 18px rgba(74, 122, 90, 0.2);
}

.mobile-container input[type="text"],
.mobile-container input[type="password"] {
    border: 1px solid #c8dcd1; /* Light sage border */
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.95rem;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(42, 61, 52, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-container input[type="text"]:focus,
.mobile-container input[type="password"]:focus {
    outline: none;
    border-color: #4a7a5a;
    box-shadow: 0 0 0 3px rgba(74, 122, 90, 0.15);
}

/* Mobile App Mockup Styles */
.mobile-container {
    display: flex;
    justify-content: center;
    margin: 3rem auto 4rem;
    padding: 0 1rem;
    width: 100%;
    max-width: 375px;
}

.mobile-frame {
    position: relative;
    width: 100%;
    height: auto;
    padding: 70px 18px 34px;
    border-radius: 44px;
    background: linear-gradient(155deg, #0d111b, #1a2332);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 28px 60px rgba(10, 14, 29, 0.5), 0 18px 36px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.device-notch {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background: #050608;
    border-radius: 0 0 18px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.device-speaker {
    width: 66px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
}

.device-camera {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #4d7dff, #142357 60%, #050608);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.65);
}

.device-screen {
    position: relative;
    width: 100%;
    height: 60vh; /* Fixed height set to 80% of the viewport height */
    max-height: 700px; /* Maximum height for larger screens */
    background: linear-gradient(180deg, #f4f7f5 0%, #e8f0eb 100%); /* Sage gradient */
    border-radius: 32px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* allow children to shrink and enable scrolling */
    z-index: 1;
}

/* The placeholder that receives each screen; must flex and allow its child to scroll */
#screens-placeholder {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* critical for scrollable children in flex layouts */
    overflow: hidden; /* prevent content from bleeding under bottom nav */
}

.mobile-screen {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 24px 24px 28px;
    overflow-y: auto; /* allow screen content to scroll when needed */
    -webkit-overflow-scrolling: touch;
    color: #1b2538;
    min-height: 0; /* ensure scroll area is computed correctly */
}

/* Dashboard Cards */
.dash-card {
    background: #e8f0eb;
    border: 1px solid rgba(74, 122, 90, 0.18);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 22px rgba(58, 90, 64, 0.12);
    margin-bottom: 12px;
}

.dash-card--alert {
    background: #e1e7ee;
    border: 1px solid rgba(31, 69, 114, 0.18);
    box-shadow: 0 10px 22px rgba(31, 69, 114, 0.12);
}

.dash-title { color:#2a7a41; font-weight:700; margin-bottom:6px; }
.dash-sub { color:#5b6c82; font-size:0.85rem; margin-bottom:10px; }

.mini-list { display:flex; flex-direction:column; gap:8px; }
.mini-row { display:grid; grid-template-columns:1fr auto; align-items:center; padding:10px 12px; border-radius:10px; }

/* Row variants based on card context */
.dash-card--alert .mini-row { background:#2b3a50; color:#cfe3ff; }
.dash-card .mini-row { border:1px solid rgba(74,122,90,0.18); background:#ffffff; color:#1b2538; }

.mini-label { font-weight:600; }
.mini-value { display:flex; gap:6px; align-items:center; white-space:nowrap; }
.tx-good { color:#2a7a41; }
.tx-bad { color:#b84a4a; }

.mobile-screen.is-active {
    display: flex;
    flex: 1 1 auto;
}

.mobile-screen::-webkit-scrollbar {
    display: none;
}

.mobile-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #1f4572;
    letter-spacing: 0.2px;
}

.test-card {
    background: #e8f0eb;
    border: 1px solid rgba(74, 122, 90, 0.15);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 12px 24px rgba(58, 90, 64, 0.12);
}

.test-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.test-card p {
    font-size: 0.95rem;
    margin: 0 0 8px;
    color: #41536f;
}

.test-card .price {
    color: #3a5a40;
    font-weight: 700;
    font-size: 1.05rem;
}

.bottom-nav {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px 24px;
    background: rgba(244, 247, 245, 0.96);
    border-top: 1px solid rgba(42, 61, 52, 0.08);
    border-radius: 0 0 28px 28px;
    backdrop-filter: blur(6px);
}

.bottom-nav a {
    flex: 1 1 0;
    text-align: center;
    color: #4a7a5a;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 16px;
    transition: background 0.2s ease, color 0.2s ease;
}

.bottom-nav a:hover {
    background: rgba(74, 122, 90, 0.12);
    color: #2a3d34;
}

.bottom-nav a.active {
    background: #4a7a5a;
    color: #fff;
}

.device-home-indicator {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.6);
}

/* Responsive styles for webapp.html */
.mobile-container {
    width: 100%;
    max-width: 375px;
    margin: 0 auto;
}

.mobile-frame {
    width: 100%;
    height: auto;
}

@media (max-width: 500px) {
    .mobile-container {
        padding: 0 1rem;
    }
}
