
/* =========================================
   MAA MATURANI COLLEGE - MODERN LOGIN
   Animated Background + Glassmorphism
========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --secondary: #7c3aed;
    --dark: #111827;
    --muted: #64748b;
    --white: #ffffff;
    --danger: #dc2626;
}

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

html {
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
    background: linear-gradient(
        -45deg,
        #07152e,
        #123c70,
        #34216b,
        #075985,
        #111827
    );
    background-size: 400% 400%;
    animation: backgroundFlow 16s ease infinite;
}

/* Moving gradient background */
@keyframes backgroundFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animated floating light circles */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(2px);
}

body::before {
    width: clamp(180px, 35vw, 420px);
    height: clamp(180px, 35vw, 420px);
    top: -100px;
    left: -100px;
    background: radial-gradient(
        circle,
        rgba(56, 189, 248, 0.45),
        rgba(56, 189, 248, 0)
    );
    animation: floatOne 12s ease-in-out infinite alternate;
}

body::after {
    width: clamp(200px, 40vw, 480px);
    height: clamp(200px, 40vw, 480px);
    right: -120px;
    bottom: -120px;
    background: radial-gradient(
        circle,
        rgba(167, 139, 250, 0.45),
        rgba(167, 139, 250, 0)
    );
    animation: floatTwo 14s ease-in-out infinite alternate;
}

@keyframes floatOne {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(120px, 100px) scale(1.15);
    }
}

@keyframes floatTwo {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(-120px, -90px) scale(1.2);
    }
}

/* Main layout */
.container {
    width: min(100%, 1000px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(24px, 5vw, 60px);
    position: relative;
    z-index: 1;
    animation: pageEnter 0.9s ease both;
}

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

/* College information panel */
.college-info {
    color: var(--white);
    padding: clamp(10px, 2vw, 28px);
    animation: infoEnter 1s ease both;
}

@keyframes infoEnter {
    from {
        opacity: 0;
        transform: translateX(-35px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.college-info::before {
    content: "";
    display: block;
    width: 76px;
    height: 5px;
    border-radius: 20px;
    margin-bottom: 25px;
    background: linear-gradient(90deg, #38bdf8, #c4b5fd);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
    animation: barGlow 3s ease-in-out infinite alternate;
}

@keyframes barGlow {
    from {
        width: 55px;
        opacity: 0.7;
    }
    to {
        width: 110px;
        opacity: 1;
    }
}

.college-info h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.18;
    letter-spacing: -1.5px;
    font-weight: 800;
    margin-bottom: 22px;
    overflow-wrap: anywhere;
    background: linear-gradient(
        110deg,
        #ffffff 15%,
        #bfdbfe 45%,
        #e9d5ff 70%,
        #ffffff 90%
    );
    background-size: 200% auto;
    color: #ffffff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 6s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}

.college-info p {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    line-height: 1.8;
    margin-top: 8px;
}

.college-info p:last-child {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.88rem;
}

/* Login glass card */
.login-section {
    width: 100%;
    min-width: 0;
    padding: clamp(25px, 4vw, 42px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.98),
        rgba(239, 246, 255, 0.92)
    );
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    animation: cardEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.login-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent,
        #38bdf8,
        #8b5cf6,
        transparent
    );
    animation: borderLight 4s ease-in-out infinite;
}

.login-section::after {
    content: "";
    position: absolute;
    top: -110px;
    right: -100px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(96, 165, 250, 0.14),
        transparent 70%
    );
    pointer-events: none;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(35px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes borderLight {
    0% {
        left: -100%;
    }
    60%, 100% {
        left: 150%;
    }
}

.login-section:hover {
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.3),
        0 0 35px rgba(96, 165, 250, 0.12);
}

.login-section h2 {
    position: relative;
    z-index: 1;
    color: #122746;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 28px;
}

.login-section h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    margin-top: 10px;
    border-radius: 8px;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

/* Labels */
.login-section label {
    display: block;
    position: relative;
    z-index: 1;
    margin: 19px 0 8px;
    color: #243650;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Inputs and session dropdown */
.form-control {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 14px 15px;
    border: 1.5px solid #d8e2f0;
    border-radius: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.92);
    color: #15243a;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.02);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}

.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-control:hover {
    border-color: #a5bde5;
}

.form-control:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.12),
        0 8px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

select.form-control {
    cursor: pointer;
}

/* Login error message */
#loginMessage {
    position: relative;
    z-index: 1;
    margin: 15px 0;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff1f2;
    color: var(--danger);
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    animation: messageEnter 0.25s ease both;
}

@keyframes messageEnter {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 54px;
    margin-top: 27px;
    padding: 15px 18px;
    overflow: hidden;
    border: none;
    border-radius: 14px;
    background: linear-gradient(110deg, #2563eb, #4f46e5, #7c3aed);
    background-size: 200% 200%;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.26);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background-position 0.4s ease;
}

.btn-login::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    transform: skewX(-22deg);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.23),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-3px);
    background-position: 100% 50%;
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.35);
}

.btn-login:hover:not(:disabled)::before {
    left: 150%;
}

.btn-login:active:not(:disabled) {
    transform: translateY(-1px) scale(0.99);
}

.btn-login:disabled {
    opacity: 0.75;
    cursor: wait;
    box-shadow: none;
}

.btn-login:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
}

/* Small screen layout */
@media (max-width: 760px) {
    body {
        align-items: flex-start;
        padding: 35px 18px;
    }

    .container {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
        max-width: 480px;
        margin: auto;
    }

    .college-info {
        padding: 5px 4px;
        text-align: center;
    }

    .college-info::before {
        margin: 0 auto 20px;
    }

    .college-info h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        letter-spacing: -0.8px;
        margin-bottom: 12px;
    }

    .college-info p {
        font-size: 0.95rem;
        margin-top: 5px;
    }

    .college-info p:last-child {
        margin-top: 14px;
    }

    .login-section {
        padding: clamp(24px, 6vw, 34px);
        border-radius: 24px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 24px 13px;
    }

    .container {
        gap: 20px;
    }

    .college-info h1 {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .college-info p:last-child {
        font-size: 0.78rem;
        padding: 8px 11px;
    }

    .login-section {
        padding: 23px 19px;
        border-radius: 21px;
    }

    .login-section h2 {
        font-size: 1.8rem;
        margin-bottom: 23px;
    }

    .login-section label {
        margin-top: 17px;
        font-size: 0.88rem;
    }

    .form-control {
        min-height: 50px;
        padding: 13px 12px;
        border-radius: 12px;
    }

    .btn-login {
        min-height: 51px;
        margin-top: 23px;
        border-radius: 12px;
    }
}

/* Extra-small phones */
@media (max-width: 340px) {
    body {
        padding: 18px 9px;
    }

    .college-info h1 {
        font-size: 1.5rem;
    }

    .login-section {
        padding: 19px 14px;
    }

    .login-section h2 {
        font-size: 1.6rem;
    }

    .form-control {
        font-size: 16px;
        padding-inline: 10px;
    }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ================================
   MODERN ANIMATED LOGIN CARD
================================ */

.login-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(18, 25, 48, 0.96), rgba(30, 20, 55, 0.94)) padding-box,
        conic-gradient(
            from var(--border-angle, 0deg),
            #00e5ff,
            #7c3aed,
            #ff3cac,
            #fbbf24,
            #00e5ff
        ) border-box;
    box-shadow:
        0 0 25px rgba(0, 229, 255, 0.16),
        0 0 55px rgba(124, 58, 237, 0.12),
        0 25px 70px rgba(0, 0, 0, 0.35);
    animation: card-float 5s ease-in-out infinite,
               card-glow 4s ease-in-out infinite alternate;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.login-card:hover {
    box-shadow:
        0 0 32px rgba(0, 229, 255, 0.28),
        0 0 75px rgba(255, 60, 172, 0.18),
        0 30px 80px rgba(0, 0, 0, 0.4);
}

/* Moving border around all four sides */
@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.login-card {
    animation: border-spin 5s linear infinite,
               card-float 6s ease-in-out infinite;
}

@keyframes border-spin {
    to {
        --border-angle: 360deg;
    }
}

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

@keyframes card-glow {
    from {
        filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.12));
    }
    to {
        filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.2));
    }
}

/* Soft animated light inside the card */
.login-card::before {
    content: "";
    position: absolute;
    inset: -60%;
    z-index: -1;
    pointer-events: none;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(0, 229, 255, 0.08) 65deg,
        transparent 130deg,
        rgba(255, 60, 172, 0.08) 220deg,
        transparent 300deg
    );
    animation: inner-light-spin 12s linear infinite;
}

@keyframes inner-light-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Keep form controls above the animated light */
.login-card form,
.login-card h1,
.login-card h2,
.login-card p,
.login-card label {
    position: relative;
    z-index: 1;
}

/* Modern input fields */
.login-card input,
.login-card select {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    outline: none;
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease,
                background 0.3s ease,
                transform 0.3s ease;
}

.login-card input:focus,
.login-card select:focus {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12),
                0 0 20px rgba(0, 229, 255, 0.1);
    transform: translateY(-1px);
}

/* Modern animated login button */
.login-card button[type="submit"] {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(110deg, #06b6d4, #6366f1, #d946ef);
    background-size: 200% 200%;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: button-gradient 5s ease infinite;
}

.login-card button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.4);
}

.login-card button[type="submit"]:active {
    transform: scale(0.98);
}

@keyframes button-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Accessibility: respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .login-card::before,
    .login-card button[type="submit"] {
        animation: none !important;
    }

    .login-card,
    .login-card input,
    .login-card select,
    .login-card button[type="submit"] {
        transition: none !important;
    }
}
