/**
 * Login Page Styles
 * Custom styles for the CGREEN login page
 */

body {
    background: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/images/network.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
    animation: backgroundMove 30s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
    }
}

/* Override body background with gradient */
body.login-page {
    background: linear-gradient(135deg, #ffcb04 0%, #ffffff 50%, #ffcb04 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    padding: 20px;
    max-width: 450px;
    backdrop-filter: blur(15px);
    border: 3px solid #ffcb04;
    position: relative;
    z-index: 1;
}

.form-control {
    border: none;
    border-bottom: 2px solid #dfe0e0;
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
}

.form-control:focus {
    border-bottom-color: #ffcb04;
    box-shadow: none;
}

.btn-primary-custom {
    background: #ffcb04;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    color: #000000;
}

.btn-primary-custom:hover {
    background: #ffd700;
    color: #000000;
}

.btn-google {
    background: #ffffff;
    border: 2px solid #cb4023;
    border-radius: 8px;
    padding: 10px;
    color: #000000;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #cb4023;
    color: #cb4023;
}

.btn-microsoft {
    background: #ffffff;
    border: 2px solid #00a4ef;
    border-radius: 8px;
    padding: 10px;
    color: #000000;
}

.btn-microsoft:hover {
    background: #f8f9fa;
    border-color: #0078d4;
    color: #0078d4;
}

.btn-mobile-download {
    background: #ffffff;
    border: 2px solid #ffcb04;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    color: #000000;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-mobile-download:hover {
    background: #fffef5;
    border-color: #ffd700;
    color: #000000;
}

.btn-mobile-download:focus-visible {
    outline: 2px solid #ffcb04;
    outline-offset: 2px;
}

.btn-mobile-download .btn-mobile-download__label {
    font-size: 0.95rem;
}

.btn-mobile-download .btn-mobile-download__meta {
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
}

.social-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #838586;
    text-decoration: none;
    margin: 0 3px;
}

.social-icon:hover {
    background: #ffcb04;
    color: #000000;
}

.alert {
    border-radius: 8px;
    border: none;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

.captcha-box {
    position: relative;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.captcha-box::selection {
    background: transparent;
}

.captcha-box::-moz-selection {
    background: transparent;
}

.btn-close {
    filter: invert(1);
}

/* Logo HR styling */
.login-logo-hr {
    border-color: #ffcb04;
    border-width: 3px;
    border-radius: 10px;
}

/* Password toggle wrapper */
.password-toggle-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-toggle-wrapper .password-toggle-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 0 12px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease, right 0.2s ease;
    height: 100%;
}

/* Adjust toggle button position */
.password-toggle-wrapper .form-control.is-invalid ~ .password-toggle-btn {
    right: 30px;
}

.password-toggle-wrapper .password-toggle-btn:hover {
    color: #ffcb04;
}

.password-toggle-wrapper .password-toggle-btn:focus {
    outline: none;
    color: #ffcb04;
}

/* Default padding */
.password-toggle-wrapper .form-control {
    padding-right: 45px;
}

/* Increase padding */
.password-toggle-wrapper .form-control.is-invalid {
    padding-right: 75px;
}

/* Ensure error message is displayed and properly positioned */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Browser password reveal button styling */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    right: -9999px !important;
}

/* Additional browser styling */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Additional CSS for browser compatibility */
#password::-webkit-credentials-auto-fill-button,
#password::-webkit-strong-password-auto-fill-button,
#password::-ms-reveal,
#password::-ms-clear {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Username field styling */
#username {
    padding-right: 0 !important;
}

#username + .password-toggle-btn,
#username + button[class*="password-toggle"],
#username ~ .password-toggle-btn {
    display: none !important;
}

/* Captcha refresh button styling */
.captcha-refresh-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 6px 8px !important;
    border: none !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #838586 !important;
    transition: all 0.15s ease !important;
    box-shadow: none !important;
}

.captcha-refresh-btn:hover {
    background-color: rgba(255, 203, 4, 0.1) !important;
    background-image: none !important;
    border: none !important;
    color: #ffcb04 !important;
    box-shadow: none !important;
}

.captcha-refresh-btn:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    color: #ffcb04 !important;
    background-color: rgba(255, 203, 4, 0.1) !important;
    background-image: none !important;
}

.captcha-refresh-btn:active,
.captcha-refresh-btn.active,
.captcha-refresh-btn:not(:disabled):not(.disabled):active {
    background-color: rgba(255, 203, 4, 0.15) !important;
    background-image: none !important;
    border: none !important;
    color: #ffcb04 !important;
    box-shadow: none !important;
}

.captcha-refresh-btn i {
    font-size: 16px !important;
    transition: transform 0.15s ease !important;
}

.captcha-refresh-btn:hover i {
    transform: rotate(90deg) !important;
}

/* Fallback styling if Font Awesome doesn't load */
.captcha-refresh-btn .fallback-icon {
    display: none;
    font-weight: bold;
    font-size: 18px;
}

/* Show fallback if Font Awesome icon is not loaded */
.captcha-refresh-btn:not(.fa-loaded) .fas {
    display: none;
}

.captcha-refresh-btn:not(.fa-loaded) .fallback-icon {
    display: inline;
}