/* Stai Drept Login Page Styles */

.main-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .main-page-wrapper {
        align-items: flex-start !important;
    }
}

@media (max-height: 512px) {
    .main-page-wrapper {
        align-items: flex-start !important;
    }
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 32px;
    margin-bottom: 32px;
    width: 100%;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.login-container {
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Logo Styles */
.login-logo-wrapper {
    width: 100px;
    text-align: center;
    margin: 0 auto 28px auto;
}

.login-logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Login Card */
.login-card {
    background: white;
    padding: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ce1111;
}

.login-card h2 {
    font-family: inherit !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    color: #2d3748 !important;
    font-size: 24px !important;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

/* Input Row for side-by-side fields */
.input-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.input-row .input-group {
    margin-bottom: 20px;
}

.input-row .input-half {
    flex: 1;
    min-width: 0; /* Allows flex items to shrink below content size */
}

/* Stack fields vertically on mobile */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }
    
    .input-row .input-half {
        width: 100%;
    }
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 8px;
    transform: translateY(0);
    font-size: 16px;
    font-weight: 500;
    color: #cbd1d8;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
    z-index: 1;
}

.input-group .input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: white;
}

.input-group.password-group .password-input::-ms-reveal { display: none !important; }

.input-group.password-group .toggle-password-visibility {
    position: absolute; 
    right: 0; 
    top: 0;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-size: 20px; 
    cursor: pointer; 
    color: #7c7c7c;
    z-index: 2;
}

/* Remove the blue/yellow autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px white inset !important; /* or your bg color */
  box-shadow: 0 0 0 1000px white inset !important;
  -webkit-text-fill-color: #777777 !important; /* set text color */
  transition: background-color 5000s ease-in-out 0s; /* smooth trick to avoid flicker */
}

.input-group .input:focus {
    outline: none;
    border-color: #ce1111;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

/* Floating label states - using :focus-within and JavaScript classes */
.input-group:focus-within label,
.input-group.has-value label,
.input-group.input-filled label {
    top: -10px;
    left: 12px;
    transform: translateY(0);
    font-size: 12px;
    font-weight: 500;
    color: #2d3748;
    background: white;
}

/* When input is focused, make label red */
.input-group:focus-within label {
    color: #ce1111;
}

/* Handle special cases for remember me checkbox */
.input-group.remember-group label {
    position: static;
    transform: none;
    font-size: 14px;
    color: #2d3748;
    background: transparent;
    padding: 0;
    pointer-events: auto;
    z-index: auto;
}

/* Handle small elements (password requirements) */
.input-group small {
    display: block;
    margin-top: 4px;
    margin-left: 2px;
    font-size: 12px;
    color: #718096;
}

a.forgot-password {
    font-size: 12px;
    color: #ce1111;
    text-decoration: none;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

a.forgot-password:hover {
    color: #242424;
    text-decoration: underline;
}

a.forgot-password:focus {
    text-decoration: underline;
    color: #242424;
}

/* Login Button */
.login-btn:is(.btn,.button,button,[type=submit],[type=button]) {
    width: 100%;
    padding: 14px;
    background: #ce1111;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.login-btn:hover:is(.btn,.button,button,[type=submit],[type=button]) {
    color: white;
    background: #9C0B0B;
}

.login-btn:focus:is(.btn,.button,button,[type=submit],[type=button]) {
    outline: none;
    background: #9C0B0B;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.3);
    transform: translateY(-1px);
}

/* Divider */
.login-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.login-divider span {
    background: white;
    color: #718096;
    padding: 0 16px;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Remember Me Checkbox */
.remember-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px !important;
    flex-wrap: nowrap;
}

.remember-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #2d3748;
    flex-shrink: 0;
    white-space: nowrap;
}

.remember-label input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #ce1111;
    cursor: pointer;
}

.remember-text {
    user-select: none;
}

/* Error Messages */
.error-msg {
    background: #fed7d7;
    color: #9C0B0B;
    padding: 10px 12px;
    font-size: 14px;
    margin-top: 10px;
    border-left: 4px solid #ce1111;
    font-weight: 500;
}

/* Field-level Error Messages */
.field-error-msg {
    background: #fed7d7;
    color: #9C0B0B;
    padding: 6px 10px;
    font-size: 12px;
    margin-top: 6px;
    border-radius: 4px;
    font-weight: 500;
    display: block;
}

/* Invalid Input State */
.input-group.has-error .input,
.input-group .input.invalid {
    border-color: #ce1111 !important;
    background-color: #fff5f5;
}

.input-group.has-error .input:focus,
.input-group .input.invalid:focus {
    outline: none;
    border-color: #ce1111 !important;
    box-shadow: 0 0 0 3px rgba(206, 17, 17, 0.15) !important;
}

/* Invalid label color */
.input-group.has-error label {
    color: #ce1111 !important;
}

/* Success Messages */
.success-msg {
    background: #c6f6d5;
    color: #22543d;
    padding: 10px 12px;
    font-size: 14px;
    margin-top: 10px;
    border-left: 4px solid #38a169;
    font-weight: 500;
}

/* Logout Success Messages */
.info-msg {
    background: #bee3f8;
    color: #2a4365;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 10px;
    border-left: 4px solid #3182ce;
    font-weight: 500;
}

/* Register Link */
.register-link {
    text-align: center;
    font-size: 14px;
    color: #718096;
}

.register-link a {
    color: #ce1111;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    color: #242424;
    text-decoration: underline;
}

.register-link a:focus {
    color: #242424;
    text-decoration: underline;
}

.nsl-container-buttons {
    width: 100%;
}

.nsl-container-buttons a:focus .nsl-button {
    transform: translateY(-1px) !important;
    background: #f5f5f5 !important;
    outline: 1px solid #ce1111 !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.3) !important;
}

div.nsl-container .nsl-button {
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

div.nsl-container .nsl-button .nsl-button-label-container {
    padding: 14px 0 !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

div.nsl-container .nsl-button:hover {    
    background: #f5f5f5 !important;
}

.recaptcha-badge {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #718096;
}

.recaptcha-badge a {
    color: #ce1111;
    text-decoration: none;
}

.recaptcha-badge a:hover, .recaptcha-badge a:focus {
    color: #242424;
    text-decoration: underline;
}