/* ═══════════════════════════════════════════════════════════════
   HEALTHION MOBILE LOGIN — PREMIUM MOBILE-FIRST EXPERIENCE
   Brand: Healthion | Theme: Premium Teal Healthcare
   Target: 320px–480px | Touch-first | 8px grid
═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
    --m-teal: #1BC5B8;
    --m-teal-dark: #14A89F;
    --m-teal-light: #E8FAF8;
    --m-aqua: #0EA5E9;
    --m-teal-glow: rgba(27, 197, 184, 0.35);
    /* Updated for professional look */
    --m-primary: #1BC5B8;
    --m-secondary: #0EA5E9;
    --m-accent: #0D9488;
    --m-success: #10B981;
    
    --m-white: #FFFFFF;
    --m-off-white: #F7FAFA;
    --m-text: #1A2E35;
    --m-text-sec: #5A7A82;
    --m-text-muted: #8FABB3;
    --m-border: rgba(27, 197, 184, 0.15);
    --m-glass: rgba(255, 255, 255, 0.92);
    --m-glass-subtle: rgba(255, 255, 255, 0.6);
    --m-gradient: #1BC5B8; /* Solid background for professional look */
    --m-gradient-btn: linear-gradient(135deg, #1BC5B8, #0EA5E9);
    --m-shadow-card: 0 4px 20px rgba(27, 197, 184, 0.1);
    --m-shadow-lg: 0 8px 32px rgba(27, 197, 184, 0.15);
    --m-shadow-glow: 0 0 24px rgba(27, 197, 184, 0.25);
    --m-radius: 16px;
    --m-radius-pill: 50px;
    --m-radius-card: 20px;
    --m-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --m-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── HIDE DESKTOP / SHOW MOBILE ── */
.mobile-login-view { display: none; }

@media (max-width: 768px) {
    .login-container.healthion-login { display: none !important; }
    .back-home-btn { display: none !important; }
    .mobile-login-view { display: flex !important; }
}

/* ── BASE MOBILE SHELL ── */
.mobile-login-view {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background: var(--m-white);
    font-family: var(--m-font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* ── FLOATING BG SHAPES ── */
.m-bg-shape {
    position: fixed;
    border-radius: 50%;
    opacity: 0.06;
    background: var(--m-teal);
    pointer-events: none;
    z-index: 0;
}
.m-bg-shape--1 { width: 200px; height: 200px; top: -60px; right: -80px; animation: m-float 8s ease-in-out infinite; }
.m-bg-shape--2 { width: 140px; height: 140px; bottom: 80px; left: -50px; animation: m-float 10s ease-in-out infinite reverse; }
.m-bg-shape--3 { width: 100px; height: 100px; bottom: 200px; right: -30px; animation: m-float 12s ease-in-out infinite 2s; }

@keyframes m-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.08); }
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION — ROUNDED BOTTOM + BOKEH BG (Redesigned)
═══════════════════════════════════════════════════════════════ */
.m-hero {
    position: relative;
    background: var(--m-teal-dark); /* Solid professional dark teal */
    padding: 30px 24px 60px;
    overflow: hidden;
    z-index: 1;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.05);
}

/* Bokeh background circles */
.m-hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.m-hero-circle--1 {
    width: 220px; height: 220px;
    top: -60px; right: -50px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    animation: m-bokeh-drift 8s ease-in-out infinite;
}
.m-hero-circle--2 {
    width: 140px; height: 140px;
    bottom: 10px; left: -40px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: m-bokeh-drift 10s ease-in-out infinite reverse;
}

@keyframes m-bokeh-drift {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(15px, -20px) scale(1.15); opacity: 1; }
}

/* ── Top bar ── */
.m-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
}

/* Back Button */
.m-back-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s var(--m-ease);
}
.m-back-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}
.m-back-btn:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.25);
}

/* Old logo class — hide */
.m-logo { display: none !important; }
.m-logo-text { display: none !important; }

/* ── Centered Massive Logo ── */
.m-logo-center {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    margin-bottom: 20px;
}

.m-logo-center img {
    width: 140px !important;
    height: auto !important;
    max-height: 140px !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
}

/* Signup btn */
.m-signup-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 8px 16px;
    border-radius: var(--m-radius-pill);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--m-ease);
}
.m-signup-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.03); }
.m-signup-btn svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2; fill: none; }

/* ── Hero Heading ── */
.m-hero-heading {
    position: relative;
    z-index: 3;
}
.m-hero-heading h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}
.m-hero-heading p {
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
}



/* ═══════════════════════════════════════════════════════════════
   FORM BODY
═══════════════════════════════════════════════════════════════ */
.m-form-body {
    position: relative;
    z-index: 2;
    padding: 24px 20px 32px;
    margin-top: -30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--m-white);
    border-radius: 30px 30px 0 0;
}

/* ── ROLE CARDS ── */
.m-role-cards {
    display: flex;
    gap: 12px;
}
.m-role-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--m-white);
    border: 2px solid var(--m-border);
    border-radius: var(--m-radius-card);
    cursor: pointer;
    transition: all 0.3s var(--m-ease);
    box-shadow: var(--m-shadow-card);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}
.m-role-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--m-gradient);
    opacity: 0;
    transition: opacity 0.3s var(--m-ease);
    border-radius: inherit;
}
.m-role-card.active { 
    border-color: var(--m-teal); 
    box-shadow: 0 8px 24px rgba(27, 197, 184, 0.15); 
}
.m-role-card.active::before { opacity: 0.04; }
.m-role-card.active .m-role-icon { 
    background: var(--m-teal); 
    transform: scale(1.05); 
    box-shadow: 0 4px 12px rgba(27, 197, 184, 0.2);
}
.m-role-card.active .m-role-icon svg { stroke: #fff; }
.m-role-card.active .m-role-name { color: var(--m-teal); }

.m-role-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--m-off-white);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s var(--m-ease);
}
.m-role-icon svg { width: 24px; height: 24px; stroke: var(--m-text-sec); stroke-width: 1.75; fill: none; transition: all 0.3s var(--m-ease); }
.m-role-name { font-size: 14px; font-weight: 600; color: var(--m-text); position: relative; z-index: 1; }
.m-role-desc { font-size: 11px; color: var(--m-text-muted); position: relative; z-index: 1; text-align: center; }

/* ── LOGIN TABS ── */
.m-tabs {
    display: flex;
    background: var(--m-off-white);
    border-radius: var(--m-radius-pill);
    padding: 4px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.m-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: transparent;
    border-radius: var(--m-radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--m-text-muted);
    cursor: pointer;
    transition: all 0.3s var(--m-ease);
    display: flex; align-items: center; justify-content: center; gap: 5px;
    -webkit-tap-highlight-color: transparent;
    position: relative; z-index: 1;
}
.m-tab svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.m-tab.active {
    background: var(--m-white);
    color: var(--m-teal);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-weight: 600;
}

/* ── FORM INPUTS (PILL-SHAPED) ── */
.m-form { display: flex; flex-direction: column; gap: 14px; }
.m-input-group { display: flex; flex-direction: column; gap: 5px; }
.m-input-group label {
    font-size: 12px; font-weight: 600; color: var(--m-text-sec);
    text-transform: uppercase; letter-spacing: 0.5px; padding-left: 8px;
}
.m-input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.m-input-wrap .m-icon {
    position: absolute; left: 16px;
    width: 18px; height: 18px;
    stroke: var(--m-text-muted); stroke-width: 2; fill: none;
    transition: stroke 0.2s ease; pointer-events: none;
    z-index: 1;
}
.m-input-wrap input {
    width: 100%;
    padding: 15px 16px 15px 48px;
    border: 2px solid var(--m-border);
    border-radius: var(--m-radius-pill);
    font-size: 15px;
    font-family: var(--m-font);
    color: var(--m-text);
    background: var(--m-off-white);
    transition: all 0.25s var(--m-ease);
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px;
}
.m-input-wrap input::placeholder { color: var(--m-text-muted); }
.m-input-wrap input:focus {
    outline: none;
    border-color: var(--m-teal);
    background: var(--m-white);
    box-shadow: 0 0 0 4px var(--m-teal-glow);
}
.m-input-wrap:focus-within .m-icon { stroke: var(--m-teal); }
.m-toggle-pw {
    position: absolute; right: 16px; cursor: pointer;
    width: 20px; height: 20px;
    stroke: var(--m-text-muted); stroke-width: 2; fill: none;
    transition: stroke 0.2s ease; z-index: 1;
}
.m-toggle-pw:hover { stroke: var(--m-teal); }

/* ── INPUT HELPER ── */
.m-input-helper {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--m-text-muted);
    padding-left: 8px; margin-top: 2px;
}
.m-input-helper svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ── FORM OPTIONS ── */
.m-options {
    display: flex; align-items: center; justify-content: space-between;
}
.m-remember {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.m-remember input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--m-teal);
    border-radius: 4px; cursor: pointer;
}
.m-remember span { font-size: 13px; color: var(--m-text-sec); }
.m-forgot {
    font-size: 13px; color: var(--m-teal); font-weight: 600;
    text-decoration: none; transition: opacity 0.2s;
}
.m-forgot:active { opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════════
   PRIMARY CTA BUTTON — GRADIENT NEON BORDER
═══════════════════════════════════════════════════════════════ */
.m-cta-wrap { position: relative; padding: 3px; border-radius: var(--m-radius-pill); background: var(--m-gradient-btn); margin-top: 4px; }
.m-cta-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--m-white);
    color: var(--m-teal);
    border: none;
    border-radius: var(--m-radius-pill);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--m-font);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s var(--m-ease);
    position: relative; overflow: hidden;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}
.m-cta-btn:active { transform: scale(0.97); }
.m-cta-btn:hover { background: var(--m-teal); color: #fff; box-shadow: var(--m-shadow-glow); }
.m-cta-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
/* Ripple */
.m-cta-btn::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    background: radial-gradient(circle, rgba(15,163,163,0.2) 10%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
    border-radius: inherit;
}
.m-cta-btn:active::after { transform: scale(2.5); opacity: 1; transition: 0s; }
/* Loading state */
.m-cta-btn.loading { pointer-events: none; opacity: 0.8; }
.m-cta-btn .m-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(15,163,163,0.2);
    border-top-color: var(--m-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}
.m-cta-btn.loading .m-spinner { display: block; }
.m-cta-btn.loading .m-btn-label { display: none; }

/* ── DIVIDER ── */
.m-divider {
    display: flex; align-items: center; gap: 14px; margin: 4px 0;
}
.m-divider::before, .m-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--m-border), transparent);
}
.m-divider span { font-size: 12px; color: var(--m-text-muted); font-weight: 500; white-space: nowrap; }

/* ── GOOGLE BUTTON ── */
.m-google-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--m-white);
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: var(--m-radius-pill);
    font-size: 14px; font-weight: 600;
    font-family: var(--m-font);
    color: var(--m-text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s var(--m-ease);
    text-decoration: none;
    min-height: 50px;
    -webkit-tap-highlight-color: transparent;
}
.m-google-btn:hover { border-color: #4285F4; box-shadow: 0 3px 12px rgba(66,133,244,0.12); }
.m-google-btn:active { transform: scale(0.98); }
.m-google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── FOOTER ── */
.m-footer {
    text-align: center;
    padding: 16px 20px 28px;
    font-size: 14px;
    color: var(--m-text-sec);
}
.m-footer a {
    color: var(--m-teal); font-weight: 700;
    text-decoration: none; transition: opacity 0.2s;
}
.m-footer a:active { opacity: 0.7; }

/* ── MESSAGES ── */
.m-error, .m-success {
    padding: 12px 16px;
    border-radius: var(--m-radius);
    font-size: 13px;
    display: none; align-items: center; gap: 8px;
    animation: m-slideIn 0.3s var(--m-ease);
}
.m-error { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; }
.m-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #059669; }
.m-error.show, .m-success.show { display: flex; }
.m-error svg, .m-success svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }

@keyframes m-slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── ENTRANCE ANIMATIONS ── */
.m-animate-in {
    opacity: 0;
    transform: translateY(12px);
    animation: m-fadeUp 0.5s var(--m-ease) forwards;
}
.m-delay-1 { animation-delay: 0.1s; }
.m-delay-2 { animation-delay: 0.2s; }
.m-delay-3 { animation-delay: 0.25s; }
.m-delay-4 { animation-delay: 0.3s; }
.m-delay-5 { animation-delay: 0.35s; }
.m-delay-6 { animation-delay: 0.4s; }
.m-delay-7 { animation-delay: 0.45s; }

@keyframes m-fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── ULTRA SMALL (320px) ── */
@media (max-width: 360px) {
    .m-hero { padding: 16px 16px 32px; }
    .m-hero-heading h1 { font-size: 24px; }
    .m-logo-center img { width: 120px !important; max-height: 120px !important; }
    .m-form-body { padding: 0 16px 24px; }
    .m-role-card { padding: 12px 6px; }
    .m-role-icon { width: 40px; height: 40px; }
    .m-cta-btn { font-size: 15px; padding: 14px 20px; }
}
