*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.4s ease;
}

body{
    background-color: #0d1117;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- The White-out Transition --- */
body.reg-mode{
    background-color: #ffffff;
}

body.reg-mode .login-card{
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* --- QuickTable Brand Name Color Shift --- */
header h1{
	text-align: center;
    color: #58ffd0; /* Original Blue */
    margin-bottom: 5px;
}

body.reg-mode header h1{
    color: #e38a05; /* Register Purple */
}

/* --- Consistent UI Elements --- */
body.reg-mode .field input{
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

body.reg-mode .field label, 
body.reg-mode header p, 
body.reg-mode .title-link{
    color: #64748b;
}

.auth-wrapper{
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card{
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    position: relative;
}

.terminal-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid #30363d;
}

.social-icons{
    display: flex;
    gap: 15px;
    color: #8b949e;
}

.title-link{
    font-size: 12px;
    color: #58a6ff;
    cursor: pointer;
    font-weight: bold;
}

.title-link:hover{
    text-decoration: underline;
}

header p{
	text-align: center;
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 30px;
}

/* --- Input Fields & Validation --- */
.field{
    margin-bottom: 20px;
}

.field label{
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #f0f6fc;
}

.field input{
    width: 100%;
    padding: 12px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    outline: none;
}

.field input:focus{
    border-color: #58a6ff;
}

.error-text{
    color: #ffca28; /* Orange */
    font-size: 0.7rem;
    margin-top: 5px;
    display: block;
    height: 0;
    opacity: 0;
}

.error-text.visible{
    height: 15px;
    opacity: 1;
}

/* --- Sliding Retype Password Animation --- */
.hidden-field{
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0;
}

body.reg-mode .hidden-field{
    max-height: 120px;
    opacity: 1;
    margin-bottom: 20px;
}

#matchMessage{
    font-size: 0.7rem;
    margin-top: 5px;
    display: block;
    min-height: 15px;
}

/* --- Buttons & Error States --- */
.submit-Button{
    width: 100%;
    padding: 14px;
    background-color: #047a4b;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.submit-Button:hover{
    filter: brightness(1.2);
}

.submit-Button.error-state{
    background-color: #ff5f56;
    animation: shake 0.3s ease-in-out;
}

.submit-Button:disabled{
    cursor: not-allowed;
}

@keyframes shake{
    0%, 100%{transform: translateX(0);}
    25%{transform: translateX(-5px);}
    75%{transform: translateX(5px);}
}

/* designed */
/* --- Base Square Style --- */
.floatsquare{
    position: fixed;
    background-color: rgba(88, 166, 255, 0.15); /* Soft Blue */
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    animation: moveSquare 25s linear infinite;
    bottom: -150px; /* Start below the screen */
}

/* --- Individual Square Variations --- */
.floatsquare:nth-child(1){ width: 80px; height: 80px; left: 10%; animation-duration: 20s; }
.floatsquare:nth-child(2){ width: 40px; height: 40px; left: 20%; animation-duration: 15s; animation-delay: 2s; }
.floatsquare:nth-child(3){ width: 120px; height: 120px; left: 35%; animation-duration: 30s; }
.floatsquare:nth-child(4){ width: 60px; height: 60px; left: 50%; animation-duration: 22s; animation-delay: 5s; }
.floatsquare:nth-child(5){ width: 90px; height: 90px; left: 65%; animation-duration: 18s; }
.floatsquare:nth-child(6){ width: 30px; height: 30px; left: 80%; animation-duration: 12s; animation-delay: 3s; }
.floatsquare:nth-child(7){ width: 110px; height: 110px; left: 90%; animation-duration: 28s; }
.floatsquare:nth-child(8){ width: 50px; height: 50px; left: 15%; animation-duration: 24s; animation-delay: 8s; }
.floatsquare:nth-child(9){ width: 75px; height: 75px; left: 45%; animation-duration: 20s; animation-delay: 1s; }
.floatsquare:nth-child(10){ width: 100px; height: 100px; left: 75%; animation-duration: 26s; }

/* --- Floating Animation --- */
@keyframes moveSquare{
    0%{
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    50%{
        opacity: 0.4;
    }
    100%{
        transform: translateY(-120vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- Register Mode Color Shift --- */
body.reg-mode .floatsquare{
    background-color: #f5c505; /* Shift to Purple */
    border-color: #917503;
	opacity: 1;
}

/* OPTIMIZATION PHONE ONLY SARRY*/
@media (max-width: 768px) {
    .floatsquare {
        display: none !important; /* Removes them from the DOM on phones */
    }

    /* Optional: Disable all smooth transitions to save battery on phone */
    * {
        /*transition: none !important;*/
    }

    .login-card {
        backdrop-filter: none; /* Removes the heavy blur effect */
        background-color: #161b22; /* Solid color for better performance */
        width: 100%; /* Make card fit better on small screens */
    }
    
    body.reg-mode .login-card {
        background-color: #ffffff;
    }
}

/* --- Floating Background Shapes --- */

.main-display {
    position: relative;
    overflow: hidden; 
}

.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    /* Default: Hidden for cellphones */
    display: none; 
}

/* Only turn on for PC (Screens wider than 768px) */
@media (min-width: 768px) {
    .background-shapes {
        display: block;
    }
}

.shape {
    position: absolute;
    bottom: -150px;
    background-color: var(--accent);
    opacity: 0.08; /* Slightly lighter for 25 shapes so it's not distracting */
    border-radius: 4px;
    animation: rise infinite linear;
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.1; }
    90% { opacity: 0.1; }
    100% {
        transform: translateY(-120vh) rotate(360deg);
        opacity: 0;
    }
}
