:root {
    --header-h: 100px;
    --bg-color: #0f0f1a;
    --primary: #1e90ff;
    --primary-dark: #0d6efd;
    --primary-light: rgba(30, 144, 255, 0.1);
    --text-dark: #222;
    --text-light: rgba(255, 255, 255, 0.7);
    --text-lighter: rgba(255, 255, 255, 0.5);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 8px 20px rgba(30, 144, 255, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    font-family:
        "Outfit",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: radial-gradient(circle at 10% 20%, #141421, #0f0f1a 90%);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Login Box - Glass Morphism Effect */
.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-dark);
    padding: 40px 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    animation: fadeInSlideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
    border: 1px solid var(--glass-border);
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        var(--primary-light) 0%,
        transparent 70%
    );
    opacity: 0.3;
    animation: rotateGradient 15s linear infinite;
    z-index: -1;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    position: relative;
}

.login-box h2::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin: 12px auto 0;
    border-radius: 3px;
}

/* Input & Select Fields - Modern Style */
.login-box input,
.login-box select {
    width: 100%;
    padding: 14px 16px;
    margin: 6px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transition: var(--transition);
    font-family: inherit;
}

.login-box input::placeholder {
    color: var(--text-lighter);
    opacity: 0.7;
}

.login-box input:focus,
.login-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.login-box input:hover,
.login-box select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Button - Floating Effect */
.login-box button {
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.login-box button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.login-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.login-box button:hover::before {
    opacity: 1;
}

.login-box button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(30, 144, 255, 0.4);
}

/* Links - Subtle Hover Effect */
.login-box a {
    text-align: center;
    margin-top: 16px;
    display: block;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.login-box a:hover {
    color: var(--primary);
    text-decoration: none;
}

.login-box a.forgot-password {
    text-align: right;
    margin: -8px 0 12px;
    font-size: 0.85rem;
}

/* Labels - Floating Label Style */
.login-box label {
    font-weight: 500;
    margin-top: 4px;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: var(--transition);
}

/* Status Message */
#status {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 107, 107, 0.1);
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Custom Alert - Modern Dialog */
.custom-alert {
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-dark);
    border: none;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    font-family: "Outfit", sans-serif;
    z-index: 9999;
    width: 80%;
    max-width: 370px;
    white-space: pre-line;
    animation: modalIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-bottom: 6px;
}

.custom-alert-header h2 {
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-dark);
    font-weight: 600;
}

.close-alert {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: #ff4d4d;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.7;
    line-height: 1;
}

.close-alert:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.buttonContent {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.buttonContent button {
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.buttonContent button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.buttonContent button:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.buttonContent button:hover::before {
    opacity: 1;
}

.buttonContent button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(30, 144, 255, 0.4);
}

#load {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background-color: rgba(15, 15, 26, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    position: relative;
}

.spinner::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes rotateGradient {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 25px;
    }

    .custom-alert {
        width: 95%;
        padding: 25px;
    }
}

/* Micro-interactions */
.login-box input:not(:placeholder-shown) {
    background: rgba(255, 255, 255, 0.1);
}

.login-box input:valid:not(:placeholder-shown) {
    border-color: rgba(46, 213, 115, 0.3);
}

.login-box input:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 71, 87, 0.3);
}
