/* Enhanced Login Page Styles */

/* Apply subtle professional background to body when on login page */
body {
    min-height: 100vh;
    background: #f8f9fa;
}

/* Force the container to be consistent width and center it vertically */
.container .columns,
.columns {
    max-width: 700px !important;
    width: 100% !important;
    margin: 0 auto;
    justify-content: center !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Exclude columns inside message bodies from login page styling */
.message .message-body .columns {
    min-height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    align-items: initial !important;
    width: auto !important;
    justify-content: initial !important;
}

/* Removed gradient animation - no longer needed */

/* Subtle overlay pattern - removed for cleaner look */

/* Apply subtle styling to the login column container */
.column.is-one-third,
.columns .column.is-one-third {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 3rem;
    width: 600px !important;
    max-width: 600px !important;
    min-width: 600px !important;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    margin: 0 auto;
    flex: none !important;
    flex-basis: auto !important;
}

/* Override Bulma's column width constraints */
.columns:not(.is-desktop) .column.is-one-third,
.columns .column.is-one-third {
    width: 600px !important;
    max-width: 600px !important;
    flex: none !important;
}

.is-vcentered {
	height:46px;
	min-height: 46px;
	max-height:46px;
}

.column.is-one-third:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Remove animated border - keeping it simple and subtle */

/* Logo/Brand area - targeting existing structure */
.has-text-centered img {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease;
}

.column img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Title styling - targeting Bulma title classes */
.title.has-text-centered {
    text-align: center;
    margin-bottom: 2rem !important;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.title {
    font-size: 1.25rem !important;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

/* Enhanced input fields - targeting Bulma field structure */
.field {
    position: relative;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.2s both;
    width: 100% !important;
    max-width: 100% !important;
}

/* Constrain form width within the column */
form {
    width: 100% !important;
    max-width: 100% !important;
}

.field .control {
    position: relative;
    width: 100% !important;
}

.field .input,
.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem; /* Add right padding for eye icon */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.25s ease;
    background: #ffffff;
}

.field .input:hover:not(:focus),
.field input[type="text"]:hover:not(:focus),
.field input[type="password"]:hover:not(:focus),
.field input[type="email"]:hover:not(:focus) {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

.field .input:focus,
.field input[type="text"]:focus,
.field input[type="password"]:focus,
.field input[type="email"]:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

/* Submit button - green success style to match other buttons */
.button.is-success,
button[type="submit"] {
    width: auto;
    min-width: 25%;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease 0.4s both;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2);
    margin-top: 30px !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.button.is-success::before,
button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.button.is-success:hover::before,
button[type="submit"]:hover::before {
    width: 900px;
    height: 900px;
}

.button.is-success:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button.is-success:not(:hover),
button[type="submit"]:not(:hover) {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button.is-success:active,
button[type="submit"]:active {
    transform: translateY(0);
}

/* Loading state */
.button.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.button.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white !important;
    border-top-color: transparent !important;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Links - targeting footer links */
.column > div:last-child {
    text-align: center;
    margin-top: 1.5rem;
    animation: fadeInUp 0.6s ease 0.5s both;
}

.column a {
    color: #1c75bc !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
}

.column a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1557a0;
    transition: width 0.3s ease;
}

.column a:hover::after {
    width: 100%;
}

.column a:hover {
    color: #1557a0 !important;
}

/* Server environment badges and notifications for login page */
.notification.is-small.environment-badge {
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse 2s ease-in-out infinite;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.is-info.environment-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.notification.is-warning.environment-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.notification.is-danger.environment-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

/* Error messages - enhanced with danger gradient and icon layout */
.notification.is-danger:not(.environment-badge),
.message.is-danger,
.alert.is-danger,
.login-error {
    background: var(--grad-danger, linear-gradient(135deg, #dc2626 0%, #991b1b 100%));
    color: white;
    border: 2px solid #991b1b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.3s ease;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Icon styling within error messages */
.notification.is-danger:not(.environment-badge) .icon,
.message.is-danger .icon,
.alert.is-danger .icon,
.login-error .icon {
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Message content styling */
.notification.is-danger:not(.environment-badge) .message-content,
.message.is-danger .message-content,
.alert.is-danger .message-content,
.login-error .message-content {
    flex: 1;
    line-height: 1.4;
}

/* Login page specific - styled like standard boxes with danger gradient */
.column.is-one-third .notification.is-danger:not(.environment-badge),
.column.is-one-third .message.is-danger,
.column.is-one-third .alert.is-danger,
.column.is-one-third .login-error {
    background: var(--grad-danger, linear-gradient(135deg, #dc2626 0%, #991b1b 100%)) !important;
    color: white !important;
    border: 2px solid #991b1b !important;
    border-radius: 8px !important;
    padding: 0.875rem !important;
    margin-bottom: 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
    animation: subtle-shake 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

/* Login page error message icons */
.column.is-one-third .notification.is-danger:not(.environment-badge) .icon,
.column.is-one-third .message.is-danger .icon,
.column.is-one-third .alert.is-danger .icon,
.column.is-one-third .login-error .icon {
    color: white !important;
    font-size: 1.25rem !important;
    flex-shrink: 0 !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Login page error message content */
.column.is-one-third .notification.is-danger:not(.environment-badge) .message-content,
.column.is-one-third .message.is-danger .message-content,
.column.is-one-third .alert.is-danger .message-content,
.column.is-one-third .login-error .message-content {
    flex: 1 !important;
    line-height: 1.4 !important;
}

/* More subtle shake animation for login errors */
@keyframes subtle-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* Login message box styling - matches the actual HTML structure */
div.box.login-message-box {
    background: var(--grad-danger, linear-gradient(135deg, #dc2626 0%, #991b1b 100%)) !important;
    color: white !important;
    border: 2px solid #991b1b !important;
    border-radius: 8px !important;
    padding: 0.875rem !important;
    margin-top: 15px !important;
    margin-bottom: 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

/* Hover effect for login message box */
div.box.login-message-box:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35) !important;
}

/* Icon styling within login message box */
div.box.login-message-box .icon {
    color: white !important;
    font-size: 1.25rem !important;
    flex-shrink: 0 !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Message text styling within login message box */
div.box.login-message-box > div {
    flex: 1 !important;
    line-height: 1.4 !important;
    color: white !important;
}

/* Generic error classes that might be used by Rasdan UI framework */
.column.is-one-third .error,
.column.is-one-third .error-message,
.column.is-one-third .validation-error {
    background: var(--grad-danger, linear-gradient(135deg, #dc2626 0%, #991b1b 100%));
    color: white;
    border: 2px solid #991b1b;
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Login page animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Mobile responsiveness for login */
@media (max-width: 650px) {
    .column.is-one-third {
        width: 95% !important;
        max-width: 95% !important;
        min-width: auto !important;
        padding: 2rem;
        margin: 1rem;
    }
    
    .container .columns,
    .columns {
        max-width: 95% !important;
    }
    
    .title {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .column.is-one-third {
        padding: 1.5rem;
        margin: 0.5rem;
        min-width: auto !important;
    }
    
    .title {
        font-size: 1.25rem !important;
    }
    
    /* Mobile modal adjustments */
    .modal {
        padding: 10px !important;
    }
    
    .modal-card {
        max-width: 95vw !important;
        max-height: 95vh !important;
        width: 95vw !important;
    }
}

/* Modal fixes for login pages */
.modal.is-active {
    display: flex !important;
    position: fixed !important;
    z-index: 1040 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.modal-background {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(10, 10, 10, 0.86) !important;
    z-index: 40 !important;
}

.modal-card {
    position: relative !important;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto !important;
    max-height: calc(100vh - 40px) !important;
    z-index: 41 !important;
}

/* Fix modal footer height to match header */
.modal-card-foot {
    padding: 16px 24px !important; /* Match header padding */
    background-color: whitesmoke !important;
    border-top: 2px solid rgb(222, 226, 230) !important; /* Match header border */
    min-height: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.modal-card-foot .button,
.modal-card-foot button {
    min-width: 80px !important;
    margin: 0 !important; /* Override the 30px top margin from login form buttons */
}

.modal-card-foot .button:not(:last-child),
.modal-card-foot button:not(:last-child) {
    margin-right: 10px !important;
}

/* Override is-full-width container in modal footer */
.modal-card-foot .is-full-width {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure modal content is properly styled */
.modal-card-head {
    background-color: #f0f0f0 !important;
    border-bottom: 2px solid rgb(222, 226, 230) !important;
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.modal-card-title {
    line-height: 1 !important;
    font-size: 1.25rem !important;
    color: #363636 !important;
}

.modal-card-body {
    padding: 20px !important;
    background-color: white !important;
}

/* Ensure body doesn't scroll when modal is active */
body.modal-active {
    overflow: hidden !important;
}

/* Login Page Modal Fixes - Override body layout when modal is active */

/* Login page modal fixes are no longer needed since we removed flex from body */

/* Additional Login Page Enhancements */

/* Password toggle button - positioned inside the input */
.field .control {
    position: relative !important;
}

.field .control .password-icon,
.field .control .icon.password-icon {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    color: #a0aec0 !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: color 0.2s ease !important;
    z-index: 10 !important;
    pointer-events: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
}

.field .control .password-icon:hover,
.field .control .icon.password-icon:hover {
    color: #667eea !important;
}

.field .control .password-icon i,
.icon.password-icon i {
    font-size: 0.9rem !important;
    margin-right: 75px !important;
    z-index: 100000 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.field .control .password-icon:hover i,
.icon.password-icon:hover i {
    color: #667eea !important;
    transform: scale(1.05) !important;
}

/* Field error states - Bulma compatible */
.field.has-error .input,
.field.is-danger .input {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

.field-error,
.help.is-danger {
    display: block;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    animation: fadeInUp 0.3s ease;
}

/* Caps lock warning */
.caps-lock-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInDown 0.3s ease;
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.password-strength-label {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 0.25rem;
    display: block;
}

.password-strength-indicator {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}