﻿/* ====== General Layout ====== */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b, #0a1120);
    background-size: 400% 400%;
    animation: gradientMove 12s ease infinite;
    overflow: hidden;
}

/* ====== Smooth Fade ====== */
.fade-in {
    animation: fadeIn 1.2s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== Background Animation ====== */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ====== Glass Card ====== */
.glass {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 40px 36px;
    color: #e2e8f0;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .glass:hover {
        transform: scale(1.01);
        box-shadow: 0 10px 45px rgba(59,130,246,0.25);
    }

/* ====== Branding ====== */
.brand {
    text-align: center;
    margin-bottom: 28px;
}

    .brand .logo {
        width: 110px;
        height: 110px;
        object-fit: contain;
        margin-bottom: 14px;
        border-radius: 16px;
        background-color: #0f172a;
        box-shadow: 0 0 20px rgba(37,99,235,0.3);
    }

    .brand h1 {
        font-size: 1.9rem;
        color: #fff;
        font-weight: 600;
        margin-bottom: 6px;
    }

    .brand p {
        color: #94a3b8;
        font-size: 0.95rem;
    }

/* ====== Input Fields ====== */
.field {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px 45px 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
    background: rgba(15, 23, 42, 0.95);
    transform: scale(1.02);
}

/* ====== Eye Icon ====== */
.toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s, transform 0.2s;
}

    .toggle-pwd:hover {
        color: #fff;
        transform: translateY(-50%) scale(1.15);
    }

/* ====== Error & Validation ====== */
.validation {
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 4px;
    min-height: 18px;
    display: block;
}

.error-box {
    background: rgba(255, 0, 0, 0.08);
    border: 1px solid rgba(255, 0, 0, 0.15);
    color: #fecaca;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 12px;
}

/* ====== Button ====== */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

    .login-btn:hover {
        background: linear-gradient(90deg, #3b82f6, #2563eb);
        box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
        transform: translateY(-2px);
    }

    .login-btn:active {
        transform: translateY(1px);
    }
/* ====== Typing Animation ====== */
.typing-text {
    display: inline-block;
    font-size: 1.9rem;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing 2.5s steps(7, end) forwards;
    border-right: none;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 7ch;
    }
}


/* Stop blinking line when text done */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 8ch;
    }
    /* adjust to match the text length */
}

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }

    50% {
        border-color: rgba(255,255,255,0.75);
    }
}

/* Optional — hide the extra span if using the border method above */
.cursor {
    display: none;
}
/* ====== Input Icon Inside ====== */
.icon-inside {
    position: absolute;
    left: 12px;
    color: #a1a1aa;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-wrap input {
    padding-left: 38px;
}

.brand h1.typing-text {
    display: block;
    margin: 10px auto 0;
    text-align: center;
}

/* ====== Error Box with Icon ====== */
.error-box {
    background: rgba(255, 0, 0, 0.08);
    border: 1px solid rgba(255, 0, 0, 0.15);
    color: #fecaca;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .error-box i {
        color: #f87171;
        font-size: 1.1rem;
    }
/* ====== Shake Animation ====== */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-10px);
    }

    40% {
        transform: translateX(10px);
    }

    60% {
        transform: translateX(-10px);
    }

    80% {
        transform: translateX(10px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.5s ease;
}
/* ====== Button Loader ====== */
.btn-loader {
    display: none;
    margin-left: 8px;
    vertical-align: middle;
}

.login-btn.loading .btn-loader {
    display: inline-block;
}

.btn-loader span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 0.6s infinite alternate;
}

    .btn-loader span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .btn-loader span:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8px);
    }
}

/* ====== Overlay Spinner ====== */
.login-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    border-radius: 20px;
}

.overlay-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* Glass Hover */
.glass:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 50px rgba(59,130,246,0.3);
}

/* Input Focus */
input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
    background: rgba(15, 23, 42, 0.95);
}

/* Button Hover */
.login-btn:hover {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}
/* Logo Pulse */
.brand .logo {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Eye Icon Hover */
.toggle-pwd:hover {
    transform: scale(1.2);
    color: #3b82f6;
}
/* Entrance Animation */
.glass {
    transform: translateY(30px);
    opacity: 0;
    animation: slideFadeIn 1s forwards ease;
}

@keyframes slideFadeIn {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Hover Glow + Slight Rotate */
.glass:hover {
    transform: scale(1.03) rotate(-0.5deg);
    box-shadow: 0 15px 60px rgba(59,130,246,0.35);
}
