/**
 * Smart Admin Assistant - Login Page Styles
 * Styling for custom login page functionality
 */

/* Base login page improvements */
body.login {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Login form enhancements */
.login form {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.login form:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Input field styling */
.login form input[type="text"],
.login form input[type="password"],
.login form input[type="email"] {
    border-radius: 6px;
    border: 2px solid #e1e5e9;
    padding: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login form input[type="text"]:focus,
.login form input[type="password"]:focus,
.login form input[type="email"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Button styling */
.wp-core-ui .button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary:focus {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.wp-core-ui .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Logo enhancements */
.login h1 {
    margin-bottom: 30px;
}

.login h1 a {
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.login h1 a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Links styling */
.login #nav a,
.login #backtoblog a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.login #nav a:hover,
.login #backtoblog a:hover {
    color: #1d4ed8;
}

/* Remember me checkbox */
.login form .forgetmenot {
    margin-bottom: 20px;
}

.login form .forgetmenot input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Error and message styling */
.login .message,
.login #login_error {
    border-radius: 6px;
    border-left: 4px solid;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.login .message {
    border-left-color: #4CAF50;
    background: #f0f8f0;
    color: #2e7d32;
}

.login #login_error {
    border-left-color: #f44336;
    background: #fef5f5;
    color: #c62828;
}

/* Login restriction notice */
.bdtsaa-login-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bdtsaa-login-notice::before {
    content: "\f534";
    font-family: dashicons;
    font-size: 16px;
    color: #f39c12;
}

/* Privacy policy link styling */
.login .privacy-policy-page-link {
    margin-top: 16px;
    text-align: center;
}

.login .privacy-policy-page-link a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
}

/* Loading state */
.login form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.login form.loading .button-primary::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bdtsaa-login-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes bdtsaa-login-spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media screen and (max-width: 480px) {
    .login {
        padding: 20px;
    }

    .login form {
        margin-top: 20px;
        padding: 20px;
    }

    .login h1 {
        margin-bottom: 20px;
    }

    .login form input[type="text"],
    .login form input[type="password"],
    .login form input[type="email"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .wp-core-ui .button-primary {
        padding: 10px 20px;
        font-size: 14px;
    }
}



/* High contrast mode support */
@media (prefers-contrast: high) {
    .login form input[type="text"],
    .login form input[type="password"],
    .login form input[type="email"] {
        border: 3px solid #000;
    }

    .wp-core-ui .button-primary {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }

    .login #nav a,
    .login #backtoblog a {
        color: #0000ee;
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .login form,
    .login h1 a,
    .wp-core-ui .button-primary,
    .login form input[type="text"],
    .login form input[type="password"],
    .login form input[type="email"] {
        transition: none;
    }

    .wp-core-ui .button-primary:hover {
        transform: none;
    }

    .login h1 a:hover {
        transform: none;
    }
}

/* Custom background overlay for better text readability */
.login.has-background-image::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Focus indicators for accessibility */
.login form input[type="text"]:focus,
.login form input[type="password"]:focus,
.login form input[type="email"]:focus,
.wp-core-ui .button-primary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.login .screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    word-wrap: normal !important;
}

.login .screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 6px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 7px;
    width: auto;
    z-index: 100000;
}

/* Print styles */
@media print {
    body.login {
        background: white !important;
        color: black !important;
    }

    .login form {
        border: 2px solid #000 !important;
        background: white !important;
    }

    .wp-core-ui .button-primary {
        background: white !important;
        color: black !important;
        border: 2px solid #000 !important;
    }
}

/* Admin Interface Notifications and Validation */
.bdtsaa-notification {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.bdtsaa-notification-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bdtsaa-notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bdtsaa-notification-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.bdtsaa-notification-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.bdtsaa-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    margin-left: 10px;
}

.bdtsaa-notification-close:hover {
    opacity: 1;
}

.bdtsaa-validation-message {
    font-size: 12px;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 4px;
}

.bdtsaa-validation-message.bdtsaa-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bdtsaa-validation-message.bdtsaa-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.bdtsaa-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.bdtsaa-test-link {
    display: inline-block;
    margin-left: 10px;
    color: #0073aa;
    text-decoration: none;
    font-size: 12px;
    padding: 2px 6px;
    background: #f0f8ff;
    border-radius: 3px;
    border: 1px solid #c3d9ff;
}

.bdtsaa-test-link:hover {
    background: #e6f3ff;
    color: #005a87;
}

.bdtsaa-login-preview {
    margin-top: 20px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.bdtsaa-login-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
}

.bdtsaa-preview-content {
    min-height: 60px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.preview-logo {
    display: block;
    margin: 0 auto 10px;
}