/* Public grade-check entry page. Redesigned to follow Minimalist 2026 guidelines. */
:root {
    --primary-color: #805AD5; /* Pastel Purple */
    --primary-dark: #6B46C1;
    --bg-color: #FFFCEB; /* Soft light pastel yellow background */
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --text-muted: #6C757D;
    --border-color: #E6DFCD; /* Warm border color matching pastel yellow */
    --pill-bg: #E8AF30; /* Yellow / Gold */
    --border-soft: #B794F4; /* Pastel purple for soft borders */
    --btn-text-soft: #6B46C1; /* Matching pastel dark for button text */
    --pill-bg-soft: #F5D98C; /* Softer yellow gold for button backgrounds */
}

* {
    box-sizing: border-box;
}

body.academic-index-page {
    background-color: var(--bg-color) !important;
    color: var(--text-main);
    font-family: 'Sarabun', 'IBM Plex Sans Thai', sans-serif;
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
    overflow-x: hidden;
}

/* Drifting Background Blobs for Purple-Yellow Theme */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35; /* Soft, delicate opacity for minimalist look */
    mix-blend-mode: multiply;
    pointer-events: none;
    will-change: transform;
}

.bg-blob-1 {
    width: 480px;
    height: 480px;
    background: #E9D8FD !important; /* Soft Purple */
    top: -100px;
    left: -100px;
    animation: mettaDrift1 25s ease-in-out infinite alternate !important;
}

.bg-blob-2 {
    width: 550px;
    height: 550px;
    background: #FEF3C7 !important; /* Soft Gold/Yellow */
    bottom: -150px;
    right: -150px;
    animation: mettaDrift2 28s ease-in-out infinite alternate !important;
}

.bg-blob-3 {
    width: 400px;
    height: 400px;
    background: #F5D0FE !important; /* Soft Lavender */
    top: 35%;
    right: 12%;
    animation: mettaDrift3 22s ease-in-out infinite alternate !important;
}

/* Main content container with pastel purple-yellow gradient and blur to blend background */
.main-container {
    background: linear-gradient(135deg, rgba(247, 238, 255, 0.92) 0%, rgba(255, 253, 240, 0.92) 100%) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 2px solid var(--border-soft) !important; /* Soft pastel purple border */
    border-radius: 0 !important; /* Sharp corners */
    box-shadow: none !important; /* No shadow */
    max-width: 480px;
    padding: 3rem 2.2rem;
    width: 100%;
    position: relative;
    z-index: 10;
}

.logo {
    height: 175px;
    width: 175px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    filter: drop-shadow(2px 2px 0px rgba(128, 90, 213, 0.25));
    animation: logoFloat 6s ease-in-out infinite;
    display: inline-block;
}

/* Staggered entrance animations */
.main-container > * {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.main-container > *:nth-child(1) { animation-delay: 0.1s; }    /* Logo */
.main-container > *:nth-child(2) { animation-delay: 0.18s; }   /* Title */
.main-container > *:nth-child(3) { animation-delay: 0.26s; }   /* Lead text */
.main-container > *:nth-child(4) { animation-delay: 0.34s; }   /* ID check form */
.main-container > *:nth-child(5) { animation-delay: 0.42s; }   /* Divider */
.main-container > *:nth-child(6) { animation-delay: 0.5s; }    /* Small text instruction */
.main-container > *:nth-child(7) { animation-delay: 0.58s; }   /* Login button */
.main-container > *:nth-child(8) { animation-delay: 0.66s; }   /* Break element */
.main-container > *:nth-child(9) { animation-delay: 0.74s; }   /* Home link */

.academic-index-page h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.academic-index-page p.lead {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.id-form {
    margin-bottom: 1.6rem;
}

/* Input styles */
.id-input {
    border: 1px solid var(--border-soft) !important;
    border-radius: 0 !important; /* Sharp corners */
    box-shadow: none !important; /* No shadow */
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding: 0.85rem 1.1rem;
    text-align: center;
    background-color: #FFFFFF !important;
    color: var(--text-main) !important;
    transition: border-color 0.15s ease-in-out;
}

.id-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
    outline: none;
    transform: none !important; /* No vertical lift */
}

/* Search Button - Premium Purple & Yellow Interaction */
.check-btn {
    background-color: var(--pill-bg-soft) !important; /* Softer yellow gold */
    border: 1.5px solid var(--border-soft) !important; /* Soft pastel purple border */
    border-radius: 0 !important; /* Sharp corners */
    box-shadow: none !important; /* No shadow */
    color: var(--btn-text-soft) !important; /* Lighter purple text */
    font-size: 1rem;
    font-weight: 700; /* Bold but not extra */
    padding: 0.85rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.check-btn:hover {
    background-color: var(--btn-text-soft) !important; /* Fills with lighter purple */
    color: #FFFFFF !important; /* White text for contrast */
    border-color: var(--btn-text-soft) !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.check-btn:active {
    opacity: 0.85 !important;
    transform: scale(0.98) !important;
}

.check-btn::after {
    display: none !important; /* Disable glow effect for clean minimalism */
}

/* Navigation Buttons */
a.button,
a.home-btn {
    border-radius: 0 !important; /* Sharp corners */
    box-shadow: none !important; /* No shadow */
    display: block !important;
    width: 100% !important;
    font-size: 1rem;
    font-weight: 700; /* Bold */
    margin: 0.6rem 0 0 !important;
    padding: 0.85rem 1.5rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    text-align: center;
}

/* Login button - Solid Purple with Gold Border for High Contrast */
a.button {
    background-color: var(--btn-text-soft) !important; /* Lighter purple */
    border: 1.5px solid var(--border-soft) !important; /* Soft pastel border */
    color: #FFFFFF !important; /* High contrast white text */
    position: relative;
    overflow: hidden;
}

a.button:hover {
    background-color: var(--pill-bg-soft) !important; /* Soft gold fill */
    color: var(--btn-text-soft) !important; /* Lighter purple text */
    border-color: var(--btn-text-soft) !important;
    transform: none !important;
    box-shadow: none !important;
}

a.button:active {
    opacity: 0.85 !important;
    transform: scale(0.98) !important;
}

a.button::after {
    display: none !important; /* Disable glow effect */
}

/* Home Link - White background with Purple Border */
a.home-btn {
    background-color: #FFFFFF !important;
    border: 1.5px solid var(--border-soft) !important; /* Soft pastel purple outline */
    color: var(--btn-text-soft) !important;
}

a.home-btn:hover {
    background-color: var(--btn-text-soft) !important; /* Lighter purple fill on hover */
    color: #FFFFFF !important;
    border-color: var(--btn-text-soft) !important;
    transform: none !important;
    box-shadow: none !important;
}

a.home-btn:active {
    opacity: 0.85 !important;
    transform: scale(0.98) !important;
}

.divider {
    background-color: var(--border-color);
    height: 1px;
    margin: 2rem auto;
    width: 80%;
}

.credit {
    font-size: 0.84rem;
    margin-top: 1.4rem;
    color: var(--text-muted);
    position: relative;
    z-index: 10;
}

/* Animations */
@keyframes mettaDrift1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        background: #E9D8FD !important; /* Soft Purple */
    }
    50% {
        transform: translate(60px, 90px) scale(1.15) rotate(180deg);
        background: #FEF3C7 !important; /* Soft Yellow */
    }
    100% {
        transform: translate(-40px, 50px) scale(0.9) rotate(360deg);
        background: #E9D8FD !important;
    }
}

@keyframes mettaDrift2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        background: #FEF3C7 !important; /* Soft Yellow */
    }
    50% {
        transform: translate(-50px, -80px) scale(1.2) rotate(-180deg);
        background: #E9D8FD !important; /* Soft Purple */
    }
    100% {
        transform: translate(30px, -40px) scale(0.95) rotate(-360deg);
        background: #FEF3C7 !important;
    }
}

@keyframes mettaDrift3 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        background: #F5D0FE !important; /* Soft Lavender */
    }
    50% {
        transform: translate(70px, -50px) scale(1.1) rotate(180deg);
        background: #FEF3C7 !important; /* Soft Yellow */
    }
    100% {
        transform: translate(-50px, 60px) scale(0.85) rotate(360deg);
        background: #E9D8FD !important;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 576px) {
    body.academic-index-page {
        padding: 14px;
    }

    .main-container {
        padding: 2.2rem 1.4rem !important;
    }

    .logo {
        width: 145px;
        height: 145px;
        margin-bottom: 1.25rem;
    }

    .academic-index-page h1 {
        font-size: 1.8rem;
    }

    a.button,
    a.home-btn {
        display: block;
        margin: 0.5rem 0 0;
        width: 100%;
        padding: 0.8rem 1.5rem;
    }
}
