:root {
    --primary: #0052cc;
    --primary-light: #4c9aff;
    --secondary: #F97316;
    --secondary-light: #fdba74;
    --text-main: #0f172a;
    --text-muted: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Prompt', sans-serif;
    color: var(--text-main);
    background: #fdfdfd;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animations (The "Wow" Factor) */
.bg-shapes {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #f4f7fb;
}

.shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 600px; height: 600px;
    background: rgba(0, 82, 204, 0.4);
    top: -150px; left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px; height: 500px;
    background: rgba(249, 115, 22, 0.25);
    bottom: -150px; right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 450px; height: 450px;
    background: rgba(76, 154, 255, 0.3);
    top: 40%; left: 40%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

.noise-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 4rem;
    gap: 3rem;
}

.hero-section {
    flex: 1.2;
}

/* Logo Setup */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.brand-icon {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.desktop-only {
    display: flex;
}

.mobile-only, .mobile-flow-arrow, .escrow-card-separator, .mobile-trust-badge {
    display: none !important;
}

/* Fallback Logo (If images are not in folder) */
.fallback-icon {
    width: 50px; height: 40px; position: relative; justify-content: center;
}
.logo-blue, .logo-orange {
    width: 20px; height: 35px; border-radius: 10px 10px 0 0; position: absolute; bottom: 0;
}
.logo-blue { background: linear-gradient(180deg, var(--primary-light), var(--primary)); left: 5px; border-radius: 20px 20px 5px 20px; transform: rotate(-15deg); }
.logo-orange { background: linear-gradient(180deg, var(--secondary-light), var(--secondary)); right: 5px; border-radius: 20px 20px 20px 5px; transform: rotate(15deg); }
.fallback-text { font-size: 1.8rem; font-weight: 800; letter-spacing: 2px; margin: 0; }

/* Hero Text */
.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(0, 82, 204, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 82, 204, 0.2);
}

.hero-headline {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subheadline {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 580px;
    font-weight: 400;
}

.hero-subheadline strong {
    color: var(--text-main);
    font-weight: 700;
}

/* Section Title */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Header Bar */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 82, 204, 0.15);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.05);
}

.header-badge-icon {
    color: var(--primary);
    font-size: 1.15rem;
}

.header-badge-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Main Content Row */
.main-content-row {
    display: flex;
    align-items: flex-start;
    gap: 4rem;
    width: 100%;
}

/* Glass Panel Inner */
.glass-panel-inner {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 82, 204, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    border-radius: 24px;
}

/* Escrow Card */
.escrow-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 2.25rem 2rem;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.escrow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 1rem;
    width: 100%;
}

.escrow-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* Escrow Horizontal Timeline & Role Tabs */

/* Escrow Diagram Mascot Layout */
.escrow-diagram-container {
    position: relative;
    width: 100%;
    max-width: 580px;
    height: 400px;
    margin: 0 auto;
    background: radial-gradient(circle at center, rgba(0, 82, 204, 0.03) 0%, transparent 75%);
    border-radius: 24px;
    overflow: visible;
    transition: all 0.3s ease;
}

.mascot-diagram-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.diagram-node {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.node-buyer {
    left: 5%;
    bottom: 20%;
    width: 155px;
    animation: float-buyer 4s infinite ease-in-out;
    z-index: 5;
}

.node-seller {
    right: 5%;
    bottom: 20%;
    width: 155px;
    animation: float-seller 4s infinite ease-in-out;
    z-index: 5;
}

.node-platform {
    left: 50%;
    top: 20%;
    transform: translateX(-50%);
    width: 300px; /* Scaled up to compensate for empty padding inside the image */
    animation: float-platform 5s infinite ease-in-out;
    z-index: 3; /* Behind Buyer and Seller mascots */
}

.node-mascot {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.12));
    transition: all 0.3s ease;
    z-index: 2;
}

/* Pedestals */
.pedestal {
    position: absolute;
    height: 24px;
    border-radius: 50%;
    transform: rotateX(60deg);
    z-index: 1;
    pointer-events: none;
    filter: blur(4px);
    transition: all 0.3s ease;
}

.pedestal-buyer {
    width: 110px;
    left: 50%;
    transform: translateX(-50%) rotateX(60deg);
    bottom: -8px;
    background: radial-gradient(circle, rgba(0, 82, 204, 0.6) 0%, rgba(0, 82, 204, 0) 70%);
    box-shadow: 0 0 12px rgba(0, 82, 204, 0.4), 0 0 25px rgba(0, 82, 204, 0.2);
    animation: float-buyer-shadow 4s infinite ease-in-out;
}

.pedestal-seller {
    width: 110px;
    right: 50%;
    transform: translateX(50%) rotateX(60deg);
    bottom: -8px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.6) 0%, rgba(249, 115, 22, 0) 70%);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4), 0 0 25px rgba(249, 115, 22, 0.2);
    animation: float-seller-shadow 4s infinite ease-in-out;
}

.pedestal-platform {
    width: 180px;
    left: 50%;
    transform: translateX(-50%) rotateX(60deg);
    bottom: 5px;
    background: radial-gradient(circle, rgba(0, 82, 204, 0.4) 0%, rgba(0, 82, 204, 0) 70%);
    box-shadow: 0 0 15px rgba(0, 82, 204, 0.3), 0 0 30px rgba(0, 82, 204, 0.15);
    animation: float-platform-shadow 5s infinite ease-in-out;
}

#---------- ANIMATIONS ----------#
@keyframes float-buyer {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes float-seller {
    0%, 100% { transform: translateY(-4px); }
    50% { transform: translateY(4px); }
}

@keyframes float-platform {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-50%, -6px) scale(1.02); }
}

@keyframes float-buyer-shadow {
    0%, 100% { transform: translateX(-50%) rotateX(60deg) scale(1); opacity: 0.8; }
    50% { transform: translateX(-50%) rotateX(60deg) scale(0.85); opacity: 0.45; }
}

@keyframes float-seller-shadow {
    0%, 100% { transform: translateX(50%) rotateX(60deg) scale(0.85); opacity: 0.45; }
    50% { transform: translateX(50%) rotateX(60deg) scale(1); opacity: 0.8; }
}

@keyframes float-platform-shadow {
    0%, 100% { transform: translateX(-50%) rotateX(60deg) scale(1); opacity: 0.7; }
    50% { transform: translateX(-50%) rotateX(60deg) scale(0.9); opacity: 0.35; }
}

/* SVG Connecting Paths */
.escrow-svg-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.arrow-path {
    stroke-dasharray: 5, 4;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.65;
}

.path-blue {
    stroke: #0052cc;
}

.path-orange {
    stroke: #f97316;
}

.path-green {
    stroke: #10b981;
}

/* Integrated Step Cards inside the diagram (Desktop) */
.escrow-step-card {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    padding: 0.65rem 0.9rem;
    gap: 0.75rem;
    width: 185px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06), 0 3px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 10;
}

.step-card-1 {
    left: 3%;
    top: 4%;
}

.step-card-2 {
    right: 3%;
    top: 4%;
}

.step-card-3 {
    left: 50%;
    bottom: 2%;
    transform: translateX(-50%);
    width: 220px;
}

.step-card-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.circle-blue {
    background: #0052cc;
    box-shadow: 0 2px 6px rgba(0, 82, 204, 0.2);
}

.circle-orange {
    background: #f97316;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2);
}

.circle-green {
    background: #10b981;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.step-card-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}

.step-card-text strong {
    font-size: 0.82rem;
    font-weight: 700;
}

.step-title-blue {
    color: #0052cc;
}

.step-title-orange {
    color: #f97316;
}

.step-title-green {
    color: #10b981;
}

.step-card-text p {
    font-size: 0.68rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
    line-height: 1.25;
}

/* Step Highlights (Triggered via JS class addition to .escrow-diagram-container) */
.escrow-diagram-container.highlight-step-1 .path-blue {
    stroke-width: 3.5px;
    stroke-dasharray: none;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(0, 82, 204, 0.85));
}
.escrow-diagram-container.highlight-step-1 .node-buyer {
    transform: scale(1.06);
}
.escrow-diagram-container.highlight-step-1 .step-card-1 {
    box-shadow: 0 8px 24px rgba(0, 82, 204, 0.15);
    transform: scale(1.03);
}

.escrow-diagram-container.highlight-step-2 .path-orange {
    stroke-width: 3.5px;
    stroke-dasharray: none;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.85));
}
.escrow-diagram-container.highlight-step-2 .node-seller {
    transform: scale(1.06);
}
.escrow-diagram-container.highlight-step-2 .step-card-2 {
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
    transform: scale(1.03);
}

.escrow-diagram-container.highlight-step-3 .path-green {
    stroke-width: 3.5px;
    stroke-dasharray: none;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.85));
}
.escrow-diagram-container.highlight-step-3 .node-buyer,
.escrow-diagram-container.highlight-step-3 .node-seller {
    transform: scale(1.04);
}
.escrow-diagram-container.highlight-step-3 .step-card-3 {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
    transform: translateX(-50%) scale(1.03);
}

/* 3 Feature Badges Row in Hero */
.hero-features-row-3 {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    width: 100%;
}

.hero-feature-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.hero-feature-badge:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.hero-feature-badge span.material-icons {
    font-size: 1.1rem;
}

.hero-feature-badge strong {
    font-weight: 600;
    color: var(--text-main);
}

.badge-blue {
    border-color: rgba(0, 82, 204, 0.15);
}
.badge-blue span.material-icons {
    color: var(--primary);
}

.badge-orange {
    border-color: rgba(249, 115, 22, 0.15);
}
.badge-orange span.material-icons {
    color: var(--secondary);
}

.badge-green {
    border-color: rgba(16, 185, 129, 0.15);
}
.badge-green span.material-icons {
    color: #10b981;
}

/* Mascot Glowing Platform */
.mascot-display-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascot-glow-shield {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(0, 82, 204, 0.15) 0%, rgba(0, 82, 204, 0) 70%);
    z-index: 0;
    filter: blur(15px);
    pointer-events: none;
}

.mascot-glow-platform {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 35px;
    background: radial-gradient(ellipse at center, rgba(0, 82, 204, 0.35) 0%, rgba(0, 82, 204, 0) 70%);
    z-index: 1;
    filter: blur(8px);
    pointer-events: none;
}

.role-mascot-img-landing {
    max-height: 240px;
    width: auto;
    object-fit: contain;
    z-index: 2;
    animation: mascot-hover-effect 4s infinite ease-in-out;
}

@keyframes mascot-hover-effect {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 4 Feature Badges Row */
.features-badge-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.badge-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.badge-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 82, 204, 0.2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
}

.badge-item span.material-icons {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.badge-icon-blue {
    color: var(--primary);
}

.badge-icon-green {
    color: #10b981;
}

.badge-text-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.badge-text-box strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge-text-box span {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Payment trust note — flat icon + two-line caption, no boxes */
.trust-user-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 2rem;
}

.ptr-icon {
    font-size: 1.7rem;
    color: var(--primary);
    flex-shrink: 0;
}

.ptr-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ptr-main {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

.ptr-main b {
    color: var(--primary);
    font-weight: 800;
}

.ptr-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.45;
}

/* Right Side: Login Section */
.login-section {
    flex: 0 0 440px;
    perspective: 1000px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 30px 60px rgba(0, 82, 204, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border-radius: 32px;
    padding: 3rem 2.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Forms & Inputs */
form { display: flex; flex-direction: column; gap: 1.2rem; }

.input-group { position: relative; width: 100%; }

.input-icon {
    position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 1.25rem; transition: color 0.3s;
}

input {
    width: 100%; padding: 1rem 1rem 1rem 3.2rem;
    border: 1.5px solid rgba(0, 82, 204, 0.1);
    border-radius: 14px;
    font-family: inherit; font-size: 0.95rem; color: var(--text-main);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

input::placeholder { color: #94a3b8; }

input:focus {
    outline: none; background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
}

input:focus + .input-icon, .input-group:focus-within .input-icon { color: var(--primary); }

.forgot-link { text-align: right; font-size: 0.85rem; margin-top: -0.5rem; }
.forgot-link a { color: var(--primary); text-decoration: none; font-weight: 500; }
.forgot-link a:hover { text-decoration: underline; }

/* Premium Buttons */
.btn {
    width: 100%; padding: 1.1rem; border: none; border-radius: 14px;
    font-family: inherit; font-size: 1.05rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center; gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1e3a8a);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.25);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 82, 204, 0.35);
}

.btn-primary:hover::after { left: 100%; }

/* Social Buttons */
.divider {
    display: flex; align-items: center; text-align: center; margin: 1.5rem 0; color: var(--text-muted); font-size: 0.85rem;
}
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid rgba(0,0,0,0.1); }
.divider span { padding: 0 10px; }

/* Social row: Facebook | Google side by side on desktop, stacked on mobile. */
.social-login { display: flex; flex-direction: row; gap: 0.65rem; }
.btn-social {
    flex: 1; min-width: 0; white-space: nowrap;
    padding: 0.85rem 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--text-main); font-weight: 500; font-size: 0.8rem;
}
.btn-social:hover { background: #ffffff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.btn-social img, .btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Skeleton pills while the provider list loads (removed by app.js). */
.sk-social {
    flex: 1;
    height: 47px;
    border-radius: 14px;
    background: linear-gradient(90deg, #e8edf4 25%, #f4f7fb 50%, #e8edf4 75%);
    background-size: 200% 100%;
    animation: klSocialShimmer 1.4s infinite linear;
}
@keyframes klSocialShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 560px) {
    .social-login { flex-direction: column; gap: 0.75rem; }
    .btn-social { font-size: 0.9rem; padding: 1rem 0.75rem; white-space: normal; }
    .btn-social img, .btn-social svg { width: 20px; height: 20px; }
    .sk-social { height: 54px; }
}
/* แนวนอนพื้นที่จำกัด: ซ่อน chip "เร็ว ๆ นี้" (ปุ่ม disabled จางอยู่แล้ว + มี title) */
@media (min-width: 561px) {
    .social-login .soon-chip { display: none; }
}

/* View Switching */
.view-container { position: relative; min-height: 420px; }
.view {
    position: absolute; top: 0; left: 0; width: 100%;
    opacity: 0; visibility: hidden; transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}
.view.active {
    position: relative; opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto;
}
.view.exit { transform: translateX(-20px); opacity: 0; }

h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; text-align: center; }
.subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.bottom-text { text-align: center; margin-top: 2rem; font-size: 0.9rem; color: var(--text-muted); }
.bottom-text a { color: var(--primary); text-decoration: none; font-weight: 600; }
.mt-4 { margin-top: 1rem; }

/* OTP & Role Selection (Same as before but cleaner) */
.otp-container { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.5rem; }
.otp-input { width: 48px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 600; padding: 0; }
.resend-text { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
#timer { color: var(--secondary); font-weight: 600; }

.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.role-card { background: rgba(255,255,255,0.7); border: 2px solid transparent; border-radius: 16px; padding: 1.5rem 1rem; text-align: center; cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.role-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); background: #fff;}
.role-card.buyer:hover, .role-card.buyer.selected { border-color: var(--primary); }
.role-card.seller:hover, .role-card.seller.selected { border-color: var(--secondary); }
.role-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-bottom: 0.5rem; }
.buyer .role-icon { background: rgba(0, 82, 204, 0.1); color: var(--primary); }
.seller .role-icon { background: rgba(249, 115, 22, 0.1); color: var(--secondary); }
.role-card h3 { font-size: 1.1rem; margin: 0; }
.role-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.mascot-area { display: flex; justify-content: center; align-items: center; margin-top: 1.5rem; }
.role-mascot-img {
    max-width: 320px;
    width: 100%;
    height: auto;
    object-fit: contain;
    animation: gentle-float 4s infinite ease-in-out;
}
@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
/* Bottom Full-width Trust Banner */
.bottom-trust-banner {
    width: 100%;
    background: rgba(15, 23, 42, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding: 3rem 4rem;
    margin-top: 4rem;
}

.bottom-banner-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 4rem;
    align-items: center;
}

.bottom-banner-left {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.bottom-shield-icon {
    font-size: 3rem;
    color: var(--primary);
    background: rgba(0, 82, 204, 0.08);
    padding: 0.85rem;
    border-radius: 20px;
    flex-shrink: 0;
}

.bottom-banner-desc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bottom-banner-desc h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.bottom-banner-desc p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.bottom-banner-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.bottom-grid-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.bottom-grid-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 82, 204, 0.2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
}

.bottom-grid-icon {
    font-size: 1.8rem;
    color: var(--primary);
    background: rgba(0, 82, 204, 0.06);
    padding: 0.5rem;
    border-radius: 12px;
    flex-shrink: 0;
}

.bottom-grid-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bottom-grid-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.bottom-grid-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .page-wrapper { flex-direction: column; padding: 2rem 1.5rem; gap: 2rem; }
    .page-header { flex-direction: row; justify-content: center; padding: 0.5rem 0; width: 100%; }
    .header-badge { display: none !important; }
    .main-content-row { flex-direction: column; gap: 3rem; align-items: center; }
    .hero-section { text-align: center; width: 100%; }
    .brand-logo { display: flex; justify-content: center; align-items: center; margin-bottom: 0; gap: 0.5rem; }
    .brand-logo .brand-icon { height: 40px !important; width: auto !important; }
    .brand-logo .brand-text { height: 20px !important; width: auto !important; }
    .brand-logo .fallback-icon { width: 32px !important; height: 26px !important; }
    .brand-logo .fallback-text { font-size: 1.2rem !important; }
    .hero-headline { font-size: 2.5rem; }
    .hero-subheadline { margin-bottom: 1.5rem; font-size: 0.92rem; }
    .escrow-card { padding: 1.5rem; gap: 1.5rem; }

    .features-badge-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; text-align: left; }
    .trust-user-row { justify-content: center; flex-wrap: wrap; }
    
    .login-section { flex: 1; width: 100%; max-width: 440px; }
    .mobile-only { display: flex; justify-content: center; margin-bottom: 2rem; gap: 10px;}
    .brand-icon-mobile { height: 45px; }
    .brand-text-mobile { height: 25px; align-self: center;}
    
    .bottom-trust-banner { padding: 2.5rem 1.5rem; }
    .bottom-banner-container { grid-template-columns: 1fr; gap: 2.5rem; }
    .bottom-banner-left { flex-direction: column; align-items: center; text-align: center; }
    .bottom-banner-right { grid-template-columns: repeat(2, 1fr); gap: 1rem; text-align: left; }
}

@media (max-width: 576px) {
    .features-badge-row { grid-template-columns: 1fr; }
    .bottom-banner-right { grid-template-columns: 1fr; }
    .header-badge-text { font-size: 0.75rem; }
}

@media (max-width: 768px) {
    /* Mobile keeps the landing page short: the trust banner repeats the same
       message as the hero, so it goes away entirely on small screens. */
    .bottom-trust-banner { display: none; }

    .page-wrapper {
        padding: 1.5rem 1rem !important;
        gap: 1.5rem !important;
    }

    .main-content-row {
        gap: 1.5rem !important;
    }

    .hero-headline {
        font-size: 2.1rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.2 !important;
    }

    .hero-subheadline {
        font-size: 0.84rem !important;
        line-height: 1.45 !important;
        margin-bottom: 0.75rem !important;
    }

    .badge {
        margin-bottom: 0.75rem !important;
    }

    .escrow-card {
        display: block !important;
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        border: none !important;
        background: none !important;
        box-shadow: none !important;
    }

    .mascot-diagram-image-wrapper {
        display: none !important;
    }

    .trust-user-row {
        display: none !important;
    }

    /* Mobile Mascot Hero style */
    .mobile-mascot-hero {
        display: block !important;
        text-align: center;
        margin: 0.5rem 0 1rem 0;
        width: 100%;
    }

    .mobile-mascot-img {
        max-width: 260px;
        width: 75%;
        height: auto;
        display: inline-block;
        filter: drop-shadow(0 6px 20px rgba(15, 23, 42, 0.06));
        animation: mobile-gentle-float 4s infinite ease-in-out;
    }

    @keyframes mobile-gentle-float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-5px); }
    }

    .hero-features-row-3 {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-feature-badge {
        width: 100%;
        box-sizing: border-box;
    }

    .escrow-diagram-container {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
        padding: 0 !important;
        position: relative;
        width: 100% !important;
    }

    /* Hide the desktop vertical line and SVG arrows */
    .escrow-diagram-container::before {
        display: none !important;
    }

    .escrow-svg-arrows {
        display: none !important;
    }

    /* Hide mascot wrapper and its children on mobile */
    .mascot-diagram-image-wrapper {
        display: none !important;
    }

    /* Step Cards Group horizontal row on mobile */
    .escrow-step-cards-group {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 440px !important;
        gap: 0.2rem !important;
        margin: 0 auto !important;
    }

    .escrow-step-card {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        flex: 1 !important;
        width: auto !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 0.6rem 0.3rem !important;
        border: 1px solid rgba(255, 255, 255, 0.7) !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.55) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
    }

    /* Reset border left that was used in vertical timeline */
    .escrow-step-card.step-card-1,
    .escrow-step-card.step-card-2,
    .escrow-step-card.step-card-3 {
        border-left: 1px solid rgba(255, 255, 255, 0.7) !important;
    }

    /* Interactive highlights on Mobile cards */
    .escrow-step-card.active, .escrow-step-card:hover {
        background: rgba(255, 255, 255, 0.85) !important;
        transform: translateY(-2px) !important;
    }

    .escrow-step-card.step-card-1.active, .escrow-step-card.step-card-1:hover {
        border-color: var(--primary) !important;
        box-shadow: 0 6px 15px rgba(0, 82, 204, 0.08) !important;
    }

    .escrow-step-card.step-card-2.active, .escrow-step-card.step-card-2:hover {
        border-color: var(--secondary) !important;
        box-shadow: 0 6px 15px rgba(249, 115, 22, 0.08) !important;
    }

    .escrow-step-card.step-card-3.active, .escrow-step-card.step-card-3:hover {
        border-color: #10b981 !important;
        box-shadow: 0 6px 15px rgba(16, 185, 129, 0.08) !important;
    }

    /* Inner card elements */
    .escrow-step-card .step-card-circle {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.7rem !important;
        margin-bottom: 4px !important;
    }

    .escrow-step-card .step-card-text {
        text-align: center !important;
        align-items: center !important;
        gap: 2px !important;
    }

    .escrow-step-card .step-card-text strong {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
    }

    .escrow-step-card .step-card-text p {
        font-size: 0.58rem !important;
        line-height: 1.2 !important;
        color: var(--text-muted) !important;
        margin-top: 1px !important;
    }

    /* Arrow separators between cards */
    .escrow-card-separator {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #94a3b8;
        width: 14px !important;
        flex-shrink: 0;
    }

    .escrow-card-separator span.material-icons {
        font-size: 13px !important;
    }

    /* Mobile Trust Badge at bottom of login section */
    .mobile-trust-badge {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        background: rgba(255, 255, 255, 0.7) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.8) !important;
        border-radius: 16px !important;
        padding: 0.85rem 1.25rem !important;
        width: 100% !important;
        max-width: 440px !important;
        margin: 1.5rem auto 0 auto !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    }

    .mobile-trust-icon {
        color: #10b981 !important;
        font-size: 1.4rem !important;
    }

    .mobile-trust-text {
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        color: #475569 !important;
        line-height: 1.4 !important;
        text-align: left !important;
    }
}

/* ==========================================================================
   Loading, Empty, and Error States (Premium Aesthetics)
   ========================================================================== */

/* Shimmer Skeleton Loaders */
.shimmer-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shimmer-card {
    height: 120px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.shimmer-line {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.2) 25%, rgba(226, 232, 240, 0.5) 50%, rgba(226, 232, 240, 0.2) 75%);
    background-size: 200% 100%;
    animation: shimmer-animation 1.5s infinite linear;
    border-radius: 4px;
    display: block;
}

@keyframes shimmer-animation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.shimmer-title {
    width: 60%;
    height: 16px;
    margin: 1.5rem 1rem 0.5rem 1rem;
}

.shimmer-desc {
    width: 80%;
    height: 12px;
    margin: 0.5rem 1rem 1.5rem 1rem;
}

/* Empty State Card */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px dashed rgba(0, 82, 204, 0.18);
    box-shadow: 0 10px 30px rgba(0, 82, 204, 0.02);
    transition: all 0.3s ease;
}

.empty-state-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 82, 204, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--primary, #0052cc);
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.05);
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.88rem;
    color: #475569;
    max-width: 320px;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Payment Error State Banner/Card */
.payment-error-box {
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.6), rgba(254, 226, 226, 0.6));
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
}

.payment-error-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    margin-bottom: 1rem;
    animation: errorPulse 2s infinite ease-in-out;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.payment-error-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 0.4rem;
}

.payment-error-desc {
    font-size: 0.85rem;
    color: #7f1d1d;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    max-width: 380px;
}

/* Network Offline Toast */
.network-offline-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    z-index: 9999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    font-family: 'Prompt', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.network-offline-toast.show {
    transform: translateX(-50%) translateY(0);
}

.network-offline-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: indicatorFlash 1s infinite alternate;
}

@keyframes indicatorFlash {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.btn-toast-retry {
    background: white;
    border: none;
    color: #0f172a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.btn-toast-retry:hover {
    opacity: 0.9;
}

/* QR Expiration Overlay */
.qr-expired-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    z-index: 10;
    animation: fadeIn 0.25s ease-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qr-expired-icon-box {
    color: #ef4444;
    margin-bottom: 0.5rem;
    animation: bounceSlow 2s infinite ease-in-out;
}

.qr-expired-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.qr-expired-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.8rem;
    text-align: center;
}

.btn-refresh-qr {
    background: #0052cc;
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 10px rgba(0, 82, 204, 0.25);
    transition: all 0.2s;
}

.btn-refresh-qr:hover {
    background: #0b3fa8;
    transform: translateY(-1px);
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}


