/* Trieucom Login - Modern Design with Rive Animation */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset & Base Styles */
.trieucom-login * {
    box-sizing: border-box;
}

.trieucom-login {
    font-family: 'Inter', sans-serif !important;
    background: radial-gradient(circle at top left, #f8fafc, #e2e8f0) !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    color: #1e293b !important;
}

.wp-login-lost-password {
    padding-top: 20px;
}

/* Hide WordPress logo */
.trieucom-login .wp-login-logo {
    display: none !important;
}

/* Wrapper */
.trieucom-login #login {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Brand Area */
.trieucom-brand-area {
    text-align: center;
    margin-bottom: 2rem;
}

.trieucom-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 1rem;
    padding: 0;
}

.trieucom-logo-box img {
    width: 200px !important;
    height: auto !important;
    max-height: 200px;
    object-fit: contain;
    display: block;
}

.trieucom-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.trieucom-brand-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
    margin-bottom: 0 !important;
}

/* Glass Card */
.trieucom-login #loginform {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 2px solid #e2e8f0 !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
    padding: 2.5rem !important;
    overflow: visible !important;
}

/* Rive Animation Container */
.trieucom-login #trieucom-rive-container {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
    max-height: 220px;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden;
    /* Prevent from overlapping other elements */
    z-index: 1;
    pointer-events: none;
}

.trieucom-rive-wrapper {
    width: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    max-height: 200px;
    overflow: hidden;
}

.trieucom-avatar-placeholder {
    width: 200px;
    height: 200px;
    max-width: 200px;
    max-height: 200px;
    background-color: #eff6ff;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0;
}

.trieucom-avatar-icon {
    color: rgba(59, 130, 246, 0.2);
    width: 64px;
    height: 64px;
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trieucom-login #trieucom-rive-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    z-index: 2;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Custom Avatar Image */
.trieucom-login .trieucom-custom-avatar-image {
    width: 200px;
    height: 200px;
    max-width: 200px;
    max-height: 200px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.8);
}

/* Form Styles */
.trieucom-login .form-group {
    margin-bottom: 1.25rem;
}

.trieucom-login .label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    padding: 5px 0.25rem;
    width: 100%;
}

.trieucom-login p:has(.input-wrapper),
.trieucom-login .user-pass-wrap:has(.input-wrapper) {
    display: flex;
    flex-direction: column;
}

.trieucom-login label {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 0 !important;
}

.trieucom-login p,
.trieucom-login .user-pass-wrap {
    margin-bottom: 1.25rem;
    position: relative;
}

.trieucom-login p label {
    display: block;
    margin-bottom: 0.375rem;
}

/* Remove all default WordPress input styling */
.trieucom-login p input[type="text"],
.trieucom-login p input[type="password"],
.trieucom-login .user-pass-wrap input[type="password"],
.trieucom-login .wp-pwd input[type="password"] {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Hide WordPress default password toggle and caps lock icon */
.trieucom-login .wp-hide-pw,
.trieucom-login .button.button-secondary {
    display: none !important;
    visibility: hidden !important;
}

/* Hide WordPress default caps warning */
.trieucom-login .caps-warning:not(.trieucom-caps-warning) {
    display: none !important;
    visibility: hidden !important;
}

.trieucom-login .input-wrapper .caps-warning:not(.trieucom-caps-warning) {
    display: none !important;
}

.trieucom-login .wp-pwd::before,
.trieucom-login .user-pass-wrap::before,
.trieucom-login .wp-pwd::after,
.trieucom-login .user-pass-wrap::after {
    display: none !important;
    content: none !important;
}

/* Hide any WordPress default icons in password field */
.trieucom-login .password-input-wrapper::before,
.trieucom-login input[type="password"]::before,
.trieucom-login .dashicons,
.trieucom-login .dashicons-visibility {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
}

/* Ensure only our custom icons show */
.trieucom-login .input-wrapper .input-icon,
.trieucom-login .input-wrapper .toggle-btn {
    display: flex !important;
    visibility: visible !important;
}

.trieucom-login .input-wrapper {
    position: relative;
    background-color: rgba(248, 250, 252, 0.5);
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Ensure inputs inside wrapper don't have their own borders */
.trieucom-login .input-wrapper input[type="text"],
.trieucom-login .input-wrapper input[type="password"] {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.trieucom-login .input-wrapper:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: white;
}

.trieucom-login .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.trieucom-login .input-wrapper:focus-within .input-icon {
    color: #3b82f6;
}

.trieucom-login input[type="text"],
.trieucom-login input[type="password"] {
    width: 100% !important;
    padding: 0.875rem 1rem 0.875rem 3rem !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-size: 1rem !important;
    color: #1e293b !important;
    font-family: 'Inter', sans-serif !important;
    border-radius: 0.75rem !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.trieucom-login input::placeholder {
    color: #94a3b8 !important;
}

/* Password Toggle Button */
.trieucom-login .toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0.5rem;
}

.trieucom-login .toggle-btn:hover {
    color: #475569;
}

/* Caps Lock Warning */
.trieucom-caps-warning {
    display: none !important;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    color: #b45309;
    font-size: 0.75rem;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.trieucom-caps-warning.show {
    display: flex !important;
}

/* Ensure caps warning is outside input-wrapper */
.trieucom-login .input-wrapper .trieucom-caps-warning {
    display: none !important;
}

/* Checkbox Area */
.trieucom-login .forgetmenot {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.25rem;
    margin-bottom: 1.5rem !important;
}

.trieucom-login .forgetmenot input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    border-radius: 0.25rem !important;
    cursor: pointer;
    margin: 0 !important;
}

.trieucom-login .forgetmenot label {
    font-size: 0.875rem !important;
    color: #475569 !important;
    cursor: pointer;
    user-select: none;
    font-weight: 400 !important;
    margin: 0 !important;
}

/* Submit Button - Ensure it's inside form */
.trieucom-login #loginform .submit,
.trieucom-login #lostpasswordform .submit,
.trieucom-login #resetpassform .submit,
.trieucom-login #registerform .submit {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.trieucom-login #wp-submit {
    width: 100% !important;
    background-color: #2563eb !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 1rem !important;
    border: none !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
    line-height: 1.5 !important;
    height: auto !important;
    /* Fix clickable area - ensure nothing overlaps */
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    /* Ensure proper box model */
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* Ensure button is isolated */
    isolation: isolate;
}

/* Only loginform needs margin-top on submit button */
.trieucom-login #loginform #wp-submit {
    margin-top: 15px;
}

/* Other forms don't need margin-top */
.trieucom-login #lostpasswordform #wp-submit,
.trieucom-login #resetpassform #wp-submit,
.trieucom-login #registerform #wp-submit {
    margin-top: 0;
}

.trieucom-login #wp-submit:hover {
    background-color: #1d4ed8 !important;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3) !important;
}

.trieucom-login #wp-submit:active {
    transform: scale(0.98);
}

/* Ensure .submit wrapper doesn't block clicks but stays above #nav */
/* Only apply high z-index for loginform where #nav overlaps */
.trieucom-login #loginform .submit,
.trieucom-login #loginform p.submit {
    position: relative !important;
    z-index: 9998 !important;
    pointer-events: none !important;
}

/* For other forms, use normal positioning */
.trieucom-login #lostpasswordform .submit,
.trieucom-login #resetpassform .submit,
.trieucom-login #registerform .submit {
    position: relative;
    z-index: auto;
    pointer-events: auto;
}

/* But the button itself should always receive clicks */
.trieucom-login .submit #wp-submit,
.trieucom-login p.submit #wp-submit {
    pointer-events: auto !important;
}

/* Remove any ::after or ::before that might block */
.trieucom-login .submit::after,
.trieucom-login .submit::before,
.trieucom-login p.submit::after,
.trieucom-login p.submit::before {
    display: none !important;
    content: none !important;
    pointer-events: none !important;
}

/* Ensure form elements don't overlap button */
.trieucom-login #loginform>*,
.trieucom-login #lostpasswordform>*,
.trieucom-login #resetpassform>*,
.trieucom-login #registerform>* {
    position: relative;
}

/* Make sure the Rive container doesn't extend over the button */
.trieucom-login #trieucom-rive-container {
    pointer-events: none;
}

.trieucom-login #trieucom-rive-container * {
    pointer-events: none;
}

/* But allow interaction with form inputs */
.trieucom-login input,
.trieucom-login button,
.trieucom-login a,
.trieucom-login .toggle-btn {
    pointer-events: auto !important;
}

/* ============================================
   Lost Password / Reset Password Form Styles
   ============================================ */

/* Style the lostpassword form same as login form */
.trieucom-login #lostpasswordform,
.trieucom-login #resetpassform,
.trieucom-login #registerform {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 2px solid #e2e8f0 !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
    padding: 2.5rem !important;
    overflow: visible !important;
}

/* Lost password specific styles */
.trieucom-login.wp-core-ui #lostpasswordform p,
.trieucom-login.wp-core-ui #resetpassform p,
.trieucom-login.wp-core-ui #registerform p {
    margin-bottom: 1.25rem;
}

/* Input wrapper for lostpassword form */
.trieucom-login #lostpasswordform .input-wrapper,
.trieucom-login #resetpassform .input-wrapper,
.trieucom-login #registerform .input-wrapper {
    position: relative;
    background-color: rgba(248, 250, 252, 0.5);
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

.trieucom-login #lostpasswordform .input-wrapper:focus-within,
.trieucom-login #resetpassform .input-wrapper:focus-within,
.trieucom-login #registerform .input-wrapper:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: white;
}

/* Email/Username input in lostpassword */
.trieucom-login #lostpasswordform input[type="text"],
.trieucom-login #resetpassform input[type="text"],
.trieucom-login #registerform input[type="text"],
.trieucom-login #registerform input[type="email"] {
    width: 100% !important;
    padding: 0.875rem 1rem 0.875rem 3rem !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-size: 1rem !important;
    color: #1e293b !important;
    font-family: 'Inter', sans-serif !important;
    border-radius: 0.75rem !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Message box for lostpassword page */
.trieucom-login .message.reset-pass {
    background: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    color: #166534 !important;
}

/* Adjust lost password page padding */
.wp-login-lost-password .trieucom-login #login,
.wp-login-resetpass .trieucom-login #login,
.wp-login-register .trieucom-login #login {
    padding-top: 2rem !important;
}

/* Hide Rive container on non-login pages */
.wp-login-lost-password #trieucom-rive-container,
.wp-login-resetpass #trieucom-rive-container,
.wp-login-register #trieucom-rive-container {
    display: none !important;
}

/* Add icon placeholder for lost password */
.wp-login-lost-password .trieucom-brand-area::before,
.wp-login-resetpass .trieucom-brand-area::before {
    content: '🔐';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.wp-login-register .trieucom-brand-area::before {
    content: '👤';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Footer Links */
.trieucom-login .forgot-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.trieucom-login .forgot-link:hover {
    color: #1d4ed8;
}

.trieucom-login #nav,
.trieucom-login #backtoblog {
    margin-top: 1.5rem !important;
    text-align: center;
    padding: 0 !important;
    /* Ensure nav links don't block the button - MUST be lower than .submit */
    position: relative !important;
    z-index: 1 !important;
    pointer-events: none !important;
    /* Prevent any overlap */
    background: transparent !important;
}

/* But allow clicking the links inside */
.trieucom-login #nav a,
.trieucom-login #backtoblog a {
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}

.trieucom-login #nav a,
.trieucom-login #backtoblog a {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.trieucom-login #nav a:hover,
.trieucom-login #backtoblog a:hover {
    color: #1e293b !important;
}

.trieucom-login #backtoblog a::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.25rem;
}

/* Error Messages */
.trieucom-login #login_error,
.trieucom-login .message {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.75rem !important;
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trieucom-spinner {
    animation: spin 1s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .trieucom-login #login {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    .trieucom-login #loginform {
        padding: 2rem !important;
    }

    .trieucom-avatar-placeholder {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .trieucom-login #loginform {
        padding: 1.5rem !important;
    }

    .trieucom-avatar-placeholder {
        width: 120px;
        height: 120px;
    }

    .trieucom-brand-title {
        font-size: 1.25rem;
    }
}