* {
    box-sizing: border-box;
}

html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Kanit", sans-serif;
    color: var(--slate-900);
    overflow-x: hidden;
}

.login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(45, 212, 191, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(20, 184, 166, 0.14), transparent 50%),
        linear-gradient(145deg, var(--teal-950) 0%, var(--teal-700) 42%, var(--teal-900) 100%);
}

.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bg-mesh {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.4;
    will-change: transform;
}

.orb-1 {
    width: 340px;
    height: 340px;
    background: var(--teal-300);
    top: -90px;
    right: 8%;
    animation: float 9s var(--ease-out) infinite;
}

.orb-2 {
    width: 440px;
    height: 440px;
    background: var(--teal-500);
    bottom: -130px;
    left: -90px;
    animation: float-alt 11s var(--ease-out) infinite;
}

.orb-3 {
    width: 260px;
    height: 260px;
    background: #6ee7b7;
    top: 38%;
    left: 42%;
    animation: float 13s var(--ease-out) infinite reverse;
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1120px;
    margin: 0 auto;
    padding:
        max(24px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
    align-items: center;
}

.login-showcase {
    color: #ecfdf5;
    animation: fadeSlideUp 0.7s var(--ease-out) both;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

.login-showcase h1 {
    margin: 22px 0 14px;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.showcase-text {
    max-width: 520px;
    margin: 0 0 28px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(236, 253, 245, 0.88);
    font-weight: 400;
}

.showcase-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
    max-width: 520px;
}

.showcase-stat {
    padding: 16px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    text-align: center;
    transition: transform 0.25s var(--ease-out), background 0.25s ease;
}

.showcase-stat:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.11);
}

.showcase-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #99f6e4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.showcase-stat span {
    font-size: 0.78rem;
    color: rgba(236, 253, 245, 0.72);
    font-weight: 500;
}

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    transition: transform 0.25s var(--ease-out), background 0.25s ease, border-color 0.25s ease;
}

.feature-list li:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.feature-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
    font-size: 1.25rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.feature-list strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
    font-weight: 700;
}

.feature-list span {
    color: rgba(236, 253, 245, 0.72);
    font-size: 0.875rem;
}

.login-card-wrap {
    position: relative;
    padding: 2px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(45, 212, 191, 0.35), rgba(255, 255, 255, 0.25));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    animation: fadeSlideUp 0.7s var(--ease-out) 0.12s both;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-xl);
    padding: 36px 32px 32px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
}

.card-top {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo-card {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(15, 118, 110, 0.15));
}

.card-top h2 {
    margin: 0 0 8px;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--teal-800);
    letter-spacing: -0.02em;
}

.card-top p {
    margin: 0;
    color: var(--slate-500);
    font-size: 0.95rem;
}

.error-box {
    display: none;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fef2f2, #fff1f2);
    color: #b91c1c;
    font-size: 0.925rem;
    text-align: center;
    border: 1px solid #fecaca;
}

.error-box.active {
    display: block;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 20px rgba(60, 64, 67, 0.1);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.google-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.6) 50%, transparent 60%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.google-btn:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 32px rgba(60, 64, 67, 0.14);
}

.google-btn:hover::after {
    opacity: 1;
    animation: shimmer 1.2s ease;
}

.google-btn:active {
    transform: translateY(0);
}

.google-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.login-note {
    margin-top: 22px;
    padding: 16px;
    border-radius: 14px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
}

.login-note p {
    margin: 0;
    text-align: center;
    color: var(--slate-500);
    font-size: 0.875rem;
    line-height: 1.65;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--slate-400);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

@media (max-width: 1100px) {
    .login-shell {
        gap: 32px;
    }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        align-content: center;
    }

    .login-card-wrap {
        order: -1;
    }

    .login-showcase {
        text-align: center;
    }

    .showcase-text,
    .showcase-stats,
    .feature-list {
        margin-left: auto;
        margin-right: auto;
    }

    .showcase-stats {
        max-width: 480px;
    }

    .feature-list {
        max-width: 520px;
    }

    .feature-list li:hover {
        transform: translateY(-2px);
    }

    .orb-1 {
        width: 220px;
        height: 220px;
        top: -40px;
        right: -20px;
    }

    .orb-2 {
        width: 280px;
        height: 280px;
        bottom: -80px;
        left: -60px;
    }

    .orb-3 {
        display: none;
    }
}

@media (max-width: 640px) {
    .login-showcase h1 {
        font-size: clamp(1.65rem, 7vw, 2rem);
        margin-top: 16px;
    }

    .showcase-text {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .showcase-stats {
        gap: 8px;
    }

    .showcase-stat {
        padding: 12px 10px;
        border-radius: 14px;
    }

    .showcase-stat strong {
        font-size: 1.15rem;
    }

    .feature-list {
        gap: 10px;
    }

    .feature-list li {
        padding: 12px 14px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .login-card {
        padding: 24px 18px 22px;
    }

    .login-card-wrap {
        border-radius: 24px;
    }

    .card-top h2 {
        font-size: 1.5rem;
    }

    .brand-logo-card {
        width: 64px;
        height: 64px;
    }

    .login-note {
        margin-top: 18px;
        padding: 14px;
    }

    .login-footer {
        margin-top: 18px;
    }
}

@media (max-width: 380px) {
    .brand-badge {
        font-size: 0.78rem;
        padding: 6px 12px;
    }

    .showcase-stats {
        grid-template-columns: 1fr;
    }

    .google-btn {
        font-size: 0.925rem;
        padding: 12px 14px;
    }

    .feature-list strong {
        font-size: 0.925rem;
    }

    .feature-list span {
        font-size: 0.825rem;
    }
}

@media (max-height: 720px) and (max-width: 900px) {
    .login-shell {
        min-height: auto;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .login-showcase h1 {
        margin: 14px 0 10px;
    }

    .showcase-stats,
    .feature-list {
        display: none;
    }
}

@media (hover: none) {
    .feature-list li:hover,
    .showcase-stat:hover,
    .google-btn:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb,
    .login-showcase,
    .login-card-wrap {
        animation: none;
    }
}
