/* AMS Login Page Styles */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.header {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.title {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.bgstripe1 {
    background-color: #f8f8f8;
}

.bgstripe2 {
    background-color: #ffffff;
}

.btn {
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background-color: #45a049;
}

.redtext {
    color: #ff0000;
    font-size: 12px;
}

.graytext {
    color: #666;
    font-size: 12px;
}

input[type="text"], input[type="password"], select {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
    border-color: #4CAF50;
    outline: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

td {
    padding: 5px;
    vertical-align: top;
}

/* Captcha styles */
#captchaCanvas {
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    display: block !important;
    width: 120px;
    height: 40px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-refresh-btn {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: background 0.2s;
}

.captcha-refresh-btn:hover {
    background: #e0e0e0;
}

/* Google Sign-In button styles */
.google-signin {
    display: inline-block;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 10px 16px;
    text-decoration: none;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: #3c4043;
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.google-signin:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.google-signin img {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Register link styles */
.register-link {
    color: #667eea;
    font-weight: 500;
    text-decoration: none;
    margin-left: 5px;
}

.register-link:hover {
    text-decoration: underline;
}

/* System requirements */
#ctlSystemReq {
    font-size: 11px;
    color: #666;
    margin-top: 20px;
}

/* Copyright */
p {
    text-align: center;
    color: #666;
    font-size: 11px;
    margin-top: 20px;
}

/* Welcome Block - Modern Design */
.welcome-block {
    text-align: center;
    margin: 2rem 0 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.welcome-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    border-radius: 20px 20px 0 0;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: #718096;
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1440px) {
    .welcome-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 1024px) {
    .welcome-block {
        margin: 1.5rem 0 2rem;
        padding: 1.5rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .welcome-block {
        margin: 1rem 0 1.5rem;
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .welcome-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .welcome-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .welcome-block {
        margin: 0.75rem 0 1rem;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
    }
}

/* Focus and Accessibility */
.welcome-title:focus {
    outline: 3px solid #667eea;
    outline-offset: 4px;
    border-radius: 8px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .welcome-title {
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        color: #000;
        text-shadow: none;
    }
    
    .welcome-subtitle {
        color: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .welcome-title,
    .welcome-subtitle {
        animation: none;
    }
}

/* Image styles */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

#ctlTitleImage {
    display: block !important;
    width: 353px;
    height: 69px;
}

/* Table background images */
td[background] {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* Modern Login Container - Industry Standard */
.login-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 16px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    margin: 0 !important;
    position: relative !important;
}

.login-card {
    max-width: 420px !important;
    width: 100% !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 auto !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

/* Logo Section */
.login-logo {
    text-align: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.logo-image {
    max-width: 200px;
    height: auto;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.login-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
}

/* Form Styles */
.login-form {
    padding: 2rem;
}

.form-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.password-toggle:hover {
    background: #f8f9fa;
}

/* Captcha Styles */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.captcha-canvas {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.captcha-refresh {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.captcha-refresh:hover {
    background: #5a6fd8;
}

.captcha-input {
    width: 100%;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
}

.checkbox-input {
    margin-right: 0.5rem;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Error Messages */
.form-error {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
}

/* Submit Button */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Register Section */
.register-section {
    text-align: center;
    padding: 0 2rem 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.register-text {
    color: #6c757d;
    font-size: 0.9rem;
}

.register-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
}

.register-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Google Sign-In */
.google-section {
    padding: 0 2rem 2rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider-text {
    background: white;
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: white;
    border: 2px solid #dadce0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #3c4043;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.google-button:hover {
    background: #f8f9fa;
    border-color: #c1c1c1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* System Requirements */
.system-requirements {
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.system-text {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 0.5rem;
    }
    
    .login-card {
        max-width: 100%;
    }
    
    .login-form,
    .register-section,
    .google-section,
    .system-requirements {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .login-logo {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .welcome-section {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-form,
    .register-section,
    .google-section,
    .system-requirements {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .login-logo {
        padding: 1rem;
    }
    
    .welcome-section {
        padding: 0.75rem 1rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* Override legacy styles for login page */
body {
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh !important;
    line-height: 1.6 !important;
}

/* Override table styles that might interfere */
.login-page table {
    display: none !important;
}

/* Ensure form is properly styled */
.login-form {
    padding: 2rem !important;
    margin: 0 !important;
}

/* Override any conflicting button styles */
.btn-primary {
    width: 100% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-bottom: 1.5rem !important;
    box-sizing: border-box !important;
}

/* Ensure no horizontal scroll */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
}

/* Override any legacy positioning */
.login-container * {
    box-sizing: border-box !important;
}

/* Force login card to proper size */
main.login-container section.login-card {
    max-width: 420px !important;
    width: 100% !important;
    min-width: 320px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 auto !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Even more specific override */
body main.login-container section.login-card {
    max-width: 420px !important;
    width: 100% !important;
    min-width: 320px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 auto !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Ensure container works properly */
main.login-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 16px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    margin: 0 !important;
    position: relative !important;
    width: 100% !important;
    height: 100vh !important;
}
