/* MaxRepTracker Auth Forms */

/* Global MRT Tap Highlight Reset */
[class^="mrt-"],
[class*=" mrt-"],
.action-button,
.password-toggle {
    -webkit-tap-highlight-color: transparent;
}

.custom-login-form,
.custom-register-form,
.custom-lostpassword-form,
.custom-resetpassword-form {
    max-width: 440px !important;
    margin: 40px auto !important;
    padding: 20px;
    /* Removed distinct background and shadow to blend with main page container */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    box-sizing: border-box !important;
}

.mrt-form-row {
    margin-bottom: 1.6em;
}

.custom-login-form h2,
.custom-register-form h2,
.custom-lostpassword-form h2,
.custom-resetpassword-form h2 {
    margin-top: 0;
    text-align: center;
}

.custom-login-form label,
.custom-register-form label,
.custom-lostpassword-form label,
.custom-resetpassword-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666666;
}

.custom-login-form input[type="text"],
.custom-login-form input[type="password"],
.custom-register-form input[type="text"],
.custom-register-form input[type="email"],
.custom-lostpassword-form input[type="text"],
.custom-resetpassword-form input[type="password"] {
    width: 100%;
    padding: 10px 40px 10px 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
}

.custom-login-form input[type="checkbox"] {
    margin-right: 5px;
}

.custom-login-form input[type="submit"],
.custom-register-form input[type="submit"],
.custom-lostpassword-form input[type="submit"],
.custom-resetpassword-form input[type="submit"],
.mrt-submit-button {
    width: 100%;
    padding: 10px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-error,
.registration-error,
.lostpassword-error,
.resetpassword-error {
    color: #92400e;
    background: #fff4e6;
    padding: 10px 10px 10px 40px;
    border-radius: 3px;
    border: 1px solid #f59e0b;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
}

.login-error::before,
.registration-error::before,
.lostpassword-error::before,
.resetpassword-error::before {
    content: "⚠️";
    position: absolute;
    left: 12px;
    font-size: 18px;
}

/* Dark theme support for error messages */
@media (prefers-color-scheme: dark) {
    .login-error,
    .registration-error,
    .lostpassword-error,
    .resetpassword-error {
        color: #fde68a;
        background: #451a03;
        border-color: #d97706;
    }
}

.login-message,
.registration-success,
.lostpassword-message {
    color: #46b450;
    background: #ebffeb;
    padding: 10px 10px 10px 40px;
    border-radius: 3px;
    border: 1px solid #46b450;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
}

.login-message::before,
.registration-success::before,
.lostpassword-message::before {
    content: "✓";
    position: absolute;
    left: 12px;
    font-size: 18px;
    font-weight: bold;
}

.password-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 40px 10px 10px;
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #666 !important;
    padding: 0;
    font-size: 16px;
    z-index: 2;
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* Eye slash effect when password is hidden */
.password-toggle::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #666;
    transform: rotate(-45deg);
    pointer-events: none;
}

/* Remove slash when password is visible (eye open) */
.password-toggle.eye-open::after {
    display: none;
}

.password-toggle:hover,
.password-toggle:active,
.password-toggle:focus {
    color: #666 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    opacity: 0.7;
}

/* Hide browser's built-in password toggle */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-caps-lock-indicator {
    display: none !important;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* Login and registration links */
.custom-login-form .login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Quick Action Menu Styles */
.custom-login-form .logged-in-buttons,
.quick-action-menu .logged-in-buttons {
    display: grid !important;
    display: -ms-grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 25px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.custom-login-form .action-button,
.quick-action-menu .action-button,
.custom-login-form a.action-button,
.quick-action-menu a.action-button,
a.action-button {
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-orient: vertical !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: column !important;
    -ms-flex-direction: column !important;
    flex-direction: column !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -webkit-box-pack: center !important;
    -webkit-justify-content: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    padding: 15px !important;
    background: #4f33ff !important;
    background-color: #4f33ff !important;
    color: white !important;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: none !important;
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
    transition: all 0.3s ease !important;
    -webkit-transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    min-height: 80px !important;
    width: 100% !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.custom-login-form .action-button:hover,
.quick-action-menu .action-button:hover {
    background: #3a26bf !important;
    background-color: #3a26bf !important;
    transform: translateY(-2px) !important;
    -webkit-transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    color: white !important;
    text-decoration: none !important;
}

.custom-login-form .action-button span,
.quick-action-menu .action-button span,
a.action-button span {
    display: block !important;
    color: white !important;
    text-align: center !important;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    border-bottom: none !important;
}

.custom-login-form .action-button span:first-child,
.quick-action-menu .action-button span:first-child {
    font-size: 20px !important;
    margin-bottom: 5px !important;
    line-height: 1.2 !important;
}

.custom-login-form .action-button span:last-child,
.quick-action-menu .action-button span:last-child {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.custom-login-form .logout-button {
    display: inline-block;
    padding: 10px 20px;
    background: #dc3232;
    color: white;
    text-decoration: none !important;
    border-radius: 3px;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.custom-login-form .logout-button:hover {
    background: #a00;
    color: white;
    text-decoration: none;
}

.custom-login-form .login-button {
    display: inline-block;
    padding: 10px 20px;
    background: #4f33ff;
    color: white;
    text-decoration: none !important;
    border-radius: 3px;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    margin-right: 10px;
}

.custom-login-form .login-button:hover {
    background: #3a26bf;
    color: white;
    text-decoration: none;
}

.custom-login-form .register-button {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none !important;
    border-radius: 3px;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.custom-login-form .register-button:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* Quick Action Menu Container */
.quick-action-menu {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
}

.quick-action-menu .menu-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #666;
}

.quick-action-menu .menu-footer {
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-top: 20px;
}

.quick-action-menu .menu-footer .logout-button {
    display: inline-block;
}

/* Google Separator */
.mrt-google-separator {
    margin-bottom: 15px;
    color: #777;
    font-size: 14px;
    text-align: center;
}

/* Responsive design */
@media (max-width: 480px) {
    .custom-login-form,
    .custom-register-form,
    .custom-lostpassword-form,
    .custom-resetpassword-form {
        padding: 15px;
        margin: 10px;
    }

    .password-toggle {
        right: 8px;
        font-size: 11px;
    }

    .custom-login-form .logged-in-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .custom-login-form .action-button {
        padding: 12px 8px;
    }

    .custom-login-form .action-button span:first-child {
        font-size: 18px;
    }

    .custom-login-form .action-button span:last-child {
        font-size: 12px;
    }

    .quick-action-menu {
        margin: 20px 10px;
    }

    .quick-action-menu .menu-container {
        padding: 20px 15px;
    }
}

@media (max-width: 360px) {
    .custom-login-form .logged-in-buttons {
        grid-template-columns: 1fr;
    }
}

/* Logout link */
/* Logout link */
.custom-logout-link {
    display: flex !important;
    justify-content: center !important;
    margin: 0 0 15px !important; /* Top margin removed to prevent double gap with Account toggle */
    padding: 20px !important;
    background: #f8f9fa !important;
    border-radius: 20px !important;
    border: 1px solid #e9ecef !important;
    box-shadow: none !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.custom-logout-link a {
    width: 100%;
}
/* Google Login alignment fixes */
.mrt-google-login-container {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    margin-top: 20px !important;
    overflow: visible !important;
    min-height: 40px;
}

.mrt-google-login-container > p {
    width: 100% !important;
    text-align: center !important;
}

.mrt-google-signin-target {
    display: inline-block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    /* Reserve exact space to prevent layout shift */
    min-height: 44px;
    height: 44px;
    width: 400px; /* Max width Google button allows */
    /* Smooth fade-in transition */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Show button after it's rendered */
.mrt-google-signin-target.loaded {
    opacity: 1;
}

/* Responsive width adjustments */
@media (max-width: 480px) {
    .mrt-google-signin-target {
        width: 100%;
        max-width: 400px;
    }
}

.mrt-google-signin-target iframe {
    max-width: none !important; /* Forces theme (Astra) to allow GSI's calculated width */
}

/* Beta Waitlist Form */
.custom-beta-waitlist {
    max-width: 440px !important;
    margin: 40px auto !important;
    padding: 40px 30px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.custom-beta-waitlist .waitlist-icon {
    margin-bottom: 20px !important;
}

.custom-beta-waitlist .waitlist-icon svg {
    color: #4f33ff !important;
}

.custom-beta-waitlist h2 {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #4f33ff 0%, #00d4ff 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.custom-beta-waitlist .waitlist-description {
    color: #666 !important;
    margin-bottom: 30px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
}

.custom-beta-waitlist .waitlist-form {
    margin-bottom: 20px !important;
}

.custom-beta-waitlist .input-wrapper input[type="email"] {
    width: 100% !important;
    padding: 16px 20px !important;
    font-size: 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.custom-beta-waitlist .input-wrapper input[type="email"]:focus {
    outline: none !important;
    border-color: #4f33ff !important;
    box-shadow: 0 0 0 4px rgba(79, 51, 255, 0.1) !important;
}

.custom-beta-waitlist .waitlist-button {
    width: 100% !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, #4f33ff 0%, #6b4dff 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

.custom-beta-waitlist .waitlist-button:hover {
    background: linear-gradient(135deg, #3a26bf 0%, #5a3ddf 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(79, 51, 255, 0.3) !important;
}

.custom-beta-waitlist .waitlist-button:active {
    transform: translateY(0) !important;
}

.custom-beta-waitlist .waitlist-button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.custom-beta-waitlist .spinner {
    animation: mrt-spin 1s linear infinite;
}

@keyframes mrt-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.custom-beta-waitlist .waitlist-message {
    padding: 14px 18px !important;
    border-radius: 10px !important;
    margin-bottom: 3px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

.custom-beta-waitlist .waitlist-message.success {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    color: #16a34a !important;
}

.custom-beta-waitlist .waitlist-message.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #dc2626 !important;
}

.custom-beta-waitlist .waitlist-note {
    color: #999 !important;
    font-size: 13px !important;
    margin: 0 !important;
}

.custom-beta-waitlist .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-beta-waitlist {
        background: rgba(30, 30, 40, 0.8) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .custom-beta-waitlist .waitlist-description,
    .custom-beta-waitlist .waitlist-note {
        color: #aaa !important;
    }

    .custom-beta-waitlist .input-wrapper input[type="email"] {
        background: rgba(50, 50, 60, 0.9) !important;
        border-color: #444 !important;
        color: #fff !important;
    }

    .custom-beta-waitlist .input-wrapper input[type="email"]::placeholder {
        color: #888 !important;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .custom-beta-waitlist {
        margin: 20px 15px !important;
        padding: 30px 20px !important;
    }

    .custom-beta-waitlist h2 {
        font-size: 24px !important;
    }

    .custom-beta-waitlist .input-wrapper input[type="email"],
    .custom-beta-waitlist .waitlist-button {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }
}
