/* Login Page Specific Styles */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

.login-background.active {
    opacity: 1;
}

.login-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(32, 69, 98, 0.88) 0%, rgba(38, 158, 173, 0.78) 100%);
    z-index: 1;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(38, 158, 173, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(32, 69, 98, 0.1) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-radius: 1.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 0 3rem;
    margin: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%);
    z-index: 1;
}

.login-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(38, 158, 173, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 12px 48px rgba(32, 69, 98, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

.login-card > * {
    position: relative;
    z-index: 2;
}

.login-logo {
    text-align: center;
    margin: 0 -3rem 1rem -3rem;
    padding: 0.5rem 2rem 0.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideDown 0.6s ease-out;
}

.login-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-logo img:hover {
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.login-header {
    text-align: center;
    margin-bottom: 1rem;
    animation: slideDown 0.6s ease-out 0.1s both;
}

.login-title {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.875rem;
    margin-bottom: 0.625rem;
    letter-spacing: -0.75px;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.925rem;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.login-form {
    position: relative;
    padding-top: 0.5rem;
}

.login-form .form-floating {
    margin-bottom: 1.25rem;
    position: relative;
    animation: fadeInUp 0.6s ease-out both;
}

.login-form .form-floating:nth-child(1) { animation-delay: 0.2s; }
.login-form .form-floating:nth-child(2) { animation-delay: 0.3s; }
.login-form .form-floating:nth-child(3) { animation-delay: 0.4s; }
.login-form .form-floating:nth-child(4) { animation-delay: 0.5s; }

.login-form .form-control {
    border: 2px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.8);
}

.login-form .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 
        0 0 0 0.25rem rgba(38, 158, 173, 0.12),
        0 2px 8px rgba(38, 158, 173, 0.1);
    transform: translateY(-1px);
    background-color: #fff;
}

.login-form .form-control:not(:placeholder-shown) {
    border-color: #ced4da;
}

.login-form .form-control:not(:placeholder-shown):focus {
    border-color: var(--primary-light);
}

/* Password Toggle Button */
.password-field {
    position: relative;
}

.btn-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10;
    transition: color 0.3s ease;
    height: auto;
    line-height: 1;
}

.btn-password-toggle:hover {
    color: var(--primary-light);
}

.btn-password-toggle:focus {
    outline: none;
    color: var(--primary-light);
}

.password-field .form-floating > label {
    padding-right: 2.5rem;
}

.login-form .input-group {
    margin-bottom: 1.25rem;
}

.login-form .input-group .form-floating {
    margin-bottom: 0;
    flex: 1;
}

.login-form .form-floating > input:read-only:not(:placeholder-shown) ~ label,
.login-form .form-floating > input:read-only:focus ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.login-form .input-group-btn {
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
}

.btn-institution-search {
    height: 58px;
    width: 58px;
    padding: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-color: var(--primary-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: #fff;
}

.btn-institution-search:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(32, 69, 98, 0.3);
}

.btn-institution-search:active {
    transform: scale(0.98);
}

.login-form .input-group {
    border-radius: 0.625rem;
    overflow: hidden;
}

.login-form .input-group .form-floating > input:read-only {
    background-color: #f8f9fa;
    cursor: pointer;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.login-form .input-group .form-floating > input:read-only:focus {
    border-right: none;
    z-index: 3;
}

.login-form .input-group .btn-institution-search {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    z-index: 3;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.login-options .form-check-label {
    color: #495057;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.login-options .form-check-label:hover {
    color: var(--primary-color);
}

.login-options .form-check {
    margin: 0;
}

.login-options .forgot-password {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.login-options .forgot-password:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.login-actions {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.login-actions .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-actions #registerBtn {
    flex: 0 0 auto;
    padding: 0.875rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 0.625rem;
    white-space: nowrap;
    border-color: #dee2e6;
    color: #6c757d;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-actions #registerBtn:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-actions #registerBtn:active {
    transform: translateY(0);
}

.login-actions .btn-primary {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    border-radius: 0.625rem;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.login-buttons > .btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    border-radius: 0.625rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.login-buttons > .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-buttons > .btn:hover::before {
    width: 300px;
    height: 300px;
}

.login-buttons > .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(32, 69, 98, 0.25);
}

.login-buttons > .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(32, 69, 98, 0.2);
}

.social-login-section {
    margin-top: 0.5rem;
}

.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0px 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.social-divider span {
    padding: 0 1rem;
    background: transparent;
    position: relative;
}

.social-login-buttons {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.social-login-buttons .btn {
    flex: 1;
    padding: 0.875rem 0.75rem;
    font-weight: 500;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    transition: all 0.3s ease;
    height: 48px;
    gap: 0.5rem;
}

.social-login-buttons .btn span {
    font-size: 0.875rem;
    white-space: nowrap;
}

.social-login-buttons .btn-smart-login {
    flex: 0 0 auto;
    width: 48px;
    padding: 0.875rem;
}

.social-login-buttons .btn:active {
    transform: translateY(0);
}

/* Override Bootstrap Primary Colors with Logo Colors */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1a3850;
    border-color: #1a3850;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-google {
    background: #fff;
    color: #3c4043;
    border: 2px solid #e8eaed;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-google::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.06) 0%, rgba(52, 168, 83, 0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-google:hover::before {
    opacity: 1;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-google i {
    font-size: 1.15rem;
    color: #4285f4;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-google:hover i {
    transform: scale(1.15);
    color: #1a73e8;
}

.btn-microsoft {
    background: #fff;
    color: #323130;
    border: 2px solid #e1dfdd;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-microsoft::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.06) 0%, rgba(0, 164, 239, 0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-microsoft:hover::before {
    opacity: 1;
}

.btn-microsoft:hover {
    background: #f3f2f1;
    border-color: #0078d4;
    color: #0078d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-microsoft:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-microsoft i {
    font-size: 1.15rem;
    color: #0078d4;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-microsoft:hover i {
    transform: scale(1.15);
    color: #005a9e;
}

.btn-smart-login {
    background: linear-gradient(135deg, #204562 0%, #269ead 100%);
    color: #fff;
    border: 2px solid transparent;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(32, 69, 98, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-smart-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-smart-login:hover::before {
    opacity: 1;
}

.btn-smart-login:hover {
    background: linear-gradient(135deg, #1a3850 0%, #1f8a9a 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(32, 69, 98, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-smart-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(32, 69, 98, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-smart-login i {
    transition: transform 0.3s ease;
}

.btn-smart-login:hover i {
    transform: scale(1.15) rotate(5deg);
}

/* Custom Switch for Remember Me */
.form-check-input[type="checkbox"] {
    width: 2.5rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    margin-right: 5px;
}

.form-check-input[type="checkbox"]:checked {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

/* Institution Search Modal */
#institutionSearchModal .modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#institutionSearchModal .modal-header {
    border-bottom: 2px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
}

#institutionSearchModal .modal-title {
    font-weight: 600;
    color: var(--primary-color);
}

#institutionSearchModal .modal-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
}

#institutionSearchModal .form-control {
    border: 2px solid #e9ecef;
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#institutionSearchModal .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(38, 158, 173, 0.15);
}

.institution-list-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}

.institution-list-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.institution-list-item:active {
    transform: translateX(2px);
}

.institution-list-item:last-child {
    border-bottom: none;
}

.institution-code {
    font-weight: 600;
    color: var(--primary-light);
}

.institution-name {
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-card {
        padding: 0 1.75rem;
        margin: 0.5rem;
        border-radius: 1.25rem;
    }
    
    .login-card:hover {
        transform: translateY(-2px) scale(1);
    }
    
    .login-logo {
        margin: 0 -1.75rem 1.5rem -1.75rem;
        padding: 2rem 1.75rem 1.25rem 1.75rem;
    }
    
    .login-logo img {
        max-width: 160px;
    }
    
    .login-card-footer {
        margin: 1.5rem -1.75rem 0 -1.75rem;
        padding: 1rem 1.75rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.85rem;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .login-options .forgot-password {
        margin-top: 0;
    }
    
    .social-divider {
        margin: 1.25rem 0 0.75rem;
    }
    
    .social-login-buttons {
        gap: 0.5rem;
    }
    
    .social-login-buttons .btn {
        padding: 0.625rem 0.5rem;
        height: 44px;
    }
    
    .social-login-buttons .btn span {
        font-size: 0.8rem;
    }
    
    .social-login-buttons .btn-smart-login {
        width: 44px;
    }
    
    .login-buttons > .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .form-floating {
        margin-bottom: 1rem;
    }
    
    .login-card-footer {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-ip,
    .footer-copyright {
        justify-content: center;
        text-align: center;
        flex: 1 1 100%;
    }
    
    .login-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .login-actions #registerBtn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .login-card {
        padding: 0 1.5rem;
    }
    
    .login-logo {
        margin: 0 -1.5rem 1.25rem -1.5rem;
        padding: 1.75rem 1.5rem 1rem 1.5rem;
    }
    
    .login-header {
        margin-bottom: 1.75rem;
    }
    
    .login-title {
        font-size: 1.625rem;
    }
    
    .login-card-footer {
        margin: 1.5rem -1.5rem 0 -1.5rem;
        padding: 1rem 1.5rem;
    }
    
    .social-login-buttons .btn {
        font-size: 1rem;
        height: 42px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeIn 0.6s ease-out;
}


/* Login Card Footer */
.login-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.25rem -3rem 0 -3rem;
    padding: 1rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    color: #6c757d;
    flex-wrap: wrap;
    gap: 0.75rem;
    position: relative;
}

.login-card-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(38, 158, 173, 0.3) 50%, 
        transparent 100%);
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.footer-ip {
    flex: 1;
    min-width: 100px;
}

.footer-version {
    flex: 0 0 auto;
    font-weight: 500;
    color: var(--primary-color);
}

.footer-copyright {
    flex: 1;
    justify-content: flex-end;
    text-align: right;
}

.footer-item i {
    font-size: 0.7rem;
    opacity: 0.7;
}

