/* Fonts and Base Setup */
body.login {
    margin: 0;
    font-family: 'Montserrat', 'Noto Sans', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Elements */
.login-bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4E73DF, #1CC88A, #6f332e, #fd6d20);
    background-size: 400% 400%;
    animation: bg-shift 20s ease-in-out infinite alternate;
    z-index: -3;
}

.login-bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 50px 50px, 100px 100px;
    background-position: 0 0, 25px 25px;
    animation: particle-drift 80s linear infinite;
    z-index: -2;
    pointer-events: none;
}

.login-bg-shine {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 60%);
    animation: shine-rotate 35s linear infinite;
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
}

/* Container */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    gap: 30px;
    position: relative;
    z-index: 2;
}

/* Cards styling with improved transparency */
.login-card, .free-trial-card {
    background: rgba(25, 25, 40, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(78, 115, 223, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 30px;
    color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.free-trial-card {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(35, 35, 55, 0.7);
}

/* Card shine effect */
.login-card::before, .free-trial-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        135deg, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 45%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0) 55%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(25deg);
    animation: card-shine 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Logo and header */
.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.login-header .logo {
    width: 60px;
    height: 60px;
    border-radius: 17%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* animation: logo-pulse 2s infinite alternate; */
}

.login-header .logo:hover {
    transform: rotate(10deg) scale(1.15);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(120deg, #ffffff, #bef8e5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Verification Badge */
.verification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #1877F2;
    border-radius: 50%;
    margin-left: 8px;
    position: relative;
    top: -4px;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3);
}

.verification-badge i {
    color: white;
    font-size: 11px;
    margin: 0;
    padding: 0;
    text-shadow: none;
}

/* Provider logo styling */
.provider-logo {
    height: 24px;
    width: auto;
    vertical-align: bottom;
    margin-left: 8px;
    border-radius: 17%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.provider-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Subtitle */
.login-subtitle {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.login-subtitle h2 {
    font-size: 18px;
    font-weight: 400;
    margin: 0;
    color: #f0f0f8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Input fields */
.input-group {
    position: relative;
    margin-bottom: 20px;
    z-index: 1;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(200, 200, 230, 0.6);
    z-index: 2;
}

.login-input {
    width: 100%;
    padding: 16px 16px 16px 45px;
    border-radius: 12px;
    border: 2px solid rgba(180, 180, 255, 0.2);
    background-color: rgba(20, 20, 40, 0.6);
    color: #f0f0f8;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.2),
        0 0 0 rgba(78, 115, 223, 0);
    font-family: 'Montserrat', 'Noto Sans', sans-serif;
}

.login-input:focus {
    border-color: #1CC88A;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(28, 200, 138, 0.4);
    background: rgba(25, 25, 50, 0.7);
}

.login-input::placeholder {
    color: rgba(200, 200, 230, 0.6);
}

/* Mobile trial option */
.mobile-trial {
    display: none;
    text-align: center;
    margin-bottom: 20px;
    font-size: 15px;
    position: relative;
    z-index: 1;
}

.mobile-trial p {
    color: #f0f0f8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Links styling */
a {
    color: #a9e2cb;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    font-weight: 500;
}

a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, transparent, #a9e2cb, transparent);
    transform: scaleX(0.5);
    opacity: 0.5;
    transition: all 0.25s ease;
}

a:hover {
    color: #d2ffe7;
    text-shadow: 0 0 8px rgba(28, 200, 138, 0.5);
}

a:hover::before {
    transform: scaleX(1);
    opacity: 1;
}

.forgot-password {
    text-align: right;
    margin: 10px 0 15px;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Buttons styling */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.primary-button, .secondary-button, .trial-button {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    border: none;
    flex: 1;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.primary-button::before, .trial-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 45%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 55%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(45deg) translateY(-100%);
    animation: button-shine 6s ease-in-out infinite;
    opacity: 0;
}

.primary-button:hover::before, .trial-button:hover::before {
    opacity: 1;
    animation: button-shine 2s ease-in-out infinite;
}

.primary-button {
    background: linear-gradient(135deg, #1CC88A, #4E73DF);
    color: white;
}

.primary-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(28, 200, 138, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.primary-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.secondary-button {
    background: linear-gradient(135deg, #3a424e, #505a74);
    color: white;
}

.secondary-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(58, 66, 78, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.trial-button {
    background: linear-gradient(135deg, #4E73DF, #1CC88A);
    color: white;
    margin-top: 20px;
}

.trial-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(78, 115, 223, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Trial card content */
.trial-card-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.trial-card-content h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.trial-card-content p {
    font-size: 16px;
    /* use a lighter font */
    font-family: 'Inter', 'Roboto Light', 'Open Sans Light', sans-serif;
    margin-bottom: 25px;
    color: #f0f0f8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Error message */
.error-message {
    color: #ff9797;
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    min-height: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    /* background: rgba(200, 0, 0, 0.1); */
    animation: fadeIn 0.5s ease;
    position: relative;
    z-index: 1;
}

/* User list */
.user-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.user-select {
    display: flex;
    flex-direction: column;
    color: #f0f0f8;
    background: linear-gradient(135deg, rgba(70, 70, 120, 0.4), rgba(50, 50, 90, 0.4));
    border: 1px solid rgba(180, 180, 255, 0.2);
    border-radius: 16px;
    padding: 18px 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
}

.user-select::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.user-select:hover {
    transform: translateY(-5px) scale(1.03);
    background: linear-gradient(135deg, rgba(80, 80, 140, 0.5), rgba(60, 60, 110, 0.5));
    border-color: rgba(200, 200, 255, 0.4);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.25),
        0 0 15px rgba(78, 115, 223, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.user-select:hover::before {
    transform: translateX(100%);
}

.user-select .user-name {
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-select .user-handle {
    font-size: 12px;
    opacity: 0.7;
}

/* Recovery block */
.recovery-block {
    display: none;
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(25, 25, 50, 0.7);
    position: relative;
    z-index: 1;
    border-left: 4px solid #1CC88A;
}

#recoverMessage {
    margin-bottom: 15px;
    font-size: 15px;
    color: #e6e6e6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes bg-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes particle-drift {
    0% { background-position: 0 0, 25px 25px; }
    100% { background-position: 1000px 1000px, 1025px 1025px; }
}

@keyframes shine-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes card-shine {
    0%, 100% { transform: rotate(25deg) translateX(-200%); }
    50% { transform: rotate(25deg) translateX(200%); }
}

@keyframes logo-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

@keyframes button-shine {
    0% { transform: rotate(45deg) translateY(-100%); }
    30%, 100% { transform: rotate(45deg) translateY(200%); }
}

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

/* Responsive design */
@media (max-width: 768px) {
    #login-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .free-trial-card {
        display: none;
    }
    
    .mobile-trial {
        display: block;
    }
    
    .login-card {
        padding: 25px 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .login-input {
        padding: 14px 14px 14px 40px;
    }
}

/* Handle display of blocks */
#handleEntryBlock, #passwordEntryBlock, #passwordRecoveryBlock {
    display: none;
}

#handleEntryBlock.active, #passwordEntryBlock.active, #passwordRecoveryBlock.active {
    display: block;
}

/* Initial display setup */
#userListBlock {
    display: block;
}

#handleEntryBlock {
    display: block;
}

#passwordEntryBlock {
    display: block;
}