/**
 * WP Passkeys Pro - Login Page Styles
 *
 * Styles for the passkey login button and related UI on wp-login.php
 *
 * @package WP_Passkeys_Pro
 */

/* Passkey Section Container */
#wp-passkeys-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Passkey Login Button */
#wp-passkeys-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#wp-passkeys-login-btn:hover {
    background: #135e96;
}

#wp-passkeys-login-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

#wp-passkeys-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#wp-passkeys-login-btn.loading {
    pointer-events: none;
}

/* Passkey Icon */
#wp-passkeys-login-btn .wp-passkeys-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Status element hidden by default (shown by JS via classList) */
#wp-passkeys-status {
    display: none;
}

/* Status Messages */
.wp-passkeys-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.wp-passkeys-status-loading {
    color: #646970;
    background: #f0f0f1;
}

.wp-passkeys-status-success {
    color: #00a32a;
    background: #edfaef;
}

.wp-passkeys-status-error {
    color: #d63638;
    background: #fcf0f1;
}

/* Divider */
.wp-passkeys-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #646970;
    font-size: 13px;
}

.wp-passkeys-divider::before,
.wp-passkeys-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #c3c4c7;
}

.wp-passkeys-divider::before {
    margin-right: 10px;
}

.wp-passkeys-divider::after {
    margin-left: 10px;
}

/* Password Fallback Link */
#wp-passkeys-use-password {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

#wp-passkeys-use-password:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Hidden utility class for toggle logic */
.wp-passkeys-hidden {
    display: none !important;
}

/* Passkey Link in Password Form */
.wp-passkeys-use-passkey-link,
#wp-passkeys-use-passkey {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

#wp-passkeys-use-passkey:hover {
    color: #135e96;
    text-decoration: underline;
}

/* When passkey is enabled, adjust login form */
.wp-passkeys-enabled #loginform {
    display: none;
}

.wp-passkeys-enabled #nav {
    display: none;
}

/* Show password form when fallback is clicked */
.wp-passkeys-enabled.show-password #loginform {
    display: block;
}

.wp-passkeys-enabled.show-password #wp-passkeys-section {
    display: none;
}

.wp-passkeys-enabled.show-password #nav {
    display: block;
}

/* Description Text */
.wp-passkeys-description {
    margin-top: 15px;
    font-size: 12px;
    color: #646970;
    line-height: 1.5;
}

/* Accessibility - Focus Styles */
#wp-passkeys-login-btn:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #wp-passkeys-login-btn {
        transition: none;
    }
}

/* Mobile Adjustments */
@media screen and (max-width: 782px) {
    #wp-passkeys-section {
        padding: 15px;
    }

    #wp-passkeys-login-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}
