@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;500;600;700;800;900&display=swap');

body {
    margin: 0;
    background: #212121;
    font-family: 'Nunito', sans-serif;
    user-select: none;
}

button, a {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    user-select: none;
}

.top-bar {
    display: none;  
    background-color: #333;
    color: #fff;
    padding: 15px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
	position: relative;
    height: 100vh;
    overflow: hidden;
}

.view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: none !important;
}

.view.view-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out-left { animation: slideOutLeft 0.35s forwards ease; }
.slide-out-right { animation: slideOutRight 0.35s forwards ease; }
.slide-in-right { animation: slideInRight 0.35s forwards ease; }
.slide-in-left { animation: slideInLeft 0.35s forwards ease; }

.view.sliding {
    transition: none !important;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

h1 {
    color: #ffffff;
    font-size: 37px;
    margin: 0 0 6px;
}

p {
    color: #9e9e9e;
    font-size: 17.3px;
    margin: 0 0 35px; 
}

.form {
    display: flex;
    flex-direction: column;
    gap: 17px;
    width: 100%;
    max-width: 350px;
	margin: 0 auto;
}

.input-container {
    position: relative;
    width: 100%;
}

.input-field {
	font-family: 'Nunito', sans-serif;
    width: 90%;
    padding: 17px 14px;
    border: 1px solid #3a3a3a;
    background: #212121;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    border-radius: 12px;
    transition: border 0.3s ease, box-shadow 0.3s ease;

}

.input-field:focus,
.input-field:not(:placeholder-shown) {
    border-color: #2b86d7;
    box-shadow: 0 0 0 1px #2b86d7;
}

.input-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8a8a;
    font-size: 17px;
    line-height: 42px;
    background: #212121;
    padding: 0 5px;
    pointer-events: none;
    transition: 0.3s ease;
	border-radius: 35%;
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
    top: -2px;
    font-size: 14px;      
    font-weight: 600;
    color: #2b86d7;
	line-height: 23px;
}

input[type="password"]::-ms-reveal {
    display: none !important;
}

.username-wrapper {
    position: relative;
}

.username-prefix {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8a8a;
    pointer-events: none;
    font-size: 17px;
    opacity: 0;
    transition: 0.2s;
	z-index: 1000;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.15);
}

.username-prefix.show-prefix {
    opacity: 1;
}

.username-wrapper .input-field {
    text-indent: 34px;
}

#login-password {
	width: 98.5%;
	box-sizing: border-box;
	padding-right: 65px;
}

.login-btn {
    position: relative;
    font-family: 'Nunito', sans-serif;
    width: 343px;
    padding: 16.5px 14px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: none;
    z-index: 1;
    margin-top: 33px;
    overflow: hidden;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.login-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #2b86d7;    
    border-radius: 10px;
    z-index: -1;
    transition: filter 0.3s ease;
}

.login-btn:not(.inactive):hover::before {
    filter: brightness(0.9);
}

.login-btn:not(.inactive):active {
    transform: scale(0.98);
}

.login-btn.inactive {
    filter: brightness(0.7);
    cursor: not-allowed;
    transition: filter 0.3s ease;
}

.register-btn {
    position: relative;
    font-family: 'Nunito', sans-serif;
    width: 343px;
    padding: 16.5px 14px;
    font-size: 17px;
    font-weight: 500;
    color: #2b86d7;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: none;
    margin-top: 13px;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.3s ease;
}

.register-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(43, 134, 215, 0);
    border-radius: 10px;
    z-index: -1;
    transition: background-color 0.4s ease;
}

.register-btn:hover::before {
    background-color: rgba(43, 134, 215, 0.1);
}

.register-btn:active {
  transform: scale(0.98);
}

.login-btn,
.register-btn {
    width: 100%;
    max-width: 343px;
}

.pass-eye {
    position: absolute;
    right: 19px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    cursor: pointer;
    user-select: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pass-eye.visible {
    opacity: 1;
    pointer-events: auto;
}

.eye {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    transition: opacity 0.3s ease;
}

.eye-show {
    background-image: url('/assets/icons/show.png');
    opacity: 1;
}

.eye-hide {
    background-image: url('/assets/icons/hide.png');
    opacity: 0;
}

.pass-eye.showing .eye-show { opacity: 1; }
.pass-eye.showing .eye-hide { opacity: 0; }

.pass-eye.hiding .eye-show { opacity: 0; }
.pass-eye.hiding .eye-hide { opacity: 1; }

.input-field.error {
    border-color: #ff4d4d !important;
    box-shadow: 0 0 0 1px #ff4d4d !important;
}

.input-label.error {
    color: #ff4d4d !important;
}

@media (max-width: 480px) {
    body, html {
        overflow: hidden;
        height: 100%;
    }
	
    .form {
        width: 100%;
        max-width: 300px;
        gap: 16px;
    }

    .input-field {
        width: 100%;
        padding: 15px;
        font-size: 15px;
        box-sizing: border-box;
    }

    #login-password {
        width: 100%;
        padding-right: 55px;
    }

    .login-btn,
    .register-btn {
        width: 100%;
        max-width: 300px;
        padding: 15px;
        font-size: 15px;
    }

    h1 {
        font-size: 30px;
    }

    p {
        font-size: 15px;
        margin-bottom: 35px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .login-btn:not(.inactive):hover::before {
        filter: brightness(1);
    }

    .register-btn:hover::before {
        background-color: rgba(43, 134, 215, 0);
    }

    .login-btn:not(.inactive):active::before {
        filter: brightness(0.9);
    }

    .register-btn:active::before {
        background-color: rgba(43, 134, 215, 0.1);
    }
}

.view-register .username-wrapper .input-field {
    text-indent: 34px;
}

.username-message {
    display: block;
    color: #8a8a8a;
    font-size: 15px;
    margin-top: -17px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
    text-align: left;
}

.username-message .arrow {
    color: #3a3a3a;
	font-weight: 800;
	margin-right: 5px;
}

.username-message.focused {
    opacity: 1;
    max-height: 80px;
    margin-top: -5px;
}

.username-message span {
    display: inline-block;
	transition: color 0.3s ease;
}
