/**
 * RunAI - Modal Styles
 */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Auth Modal Container */
.auth-modal {
    background: var(--bg-card, #0a0a0a);
    border-radius: 20px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color, #222);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1) translateY(0);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted, #666);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Content Container */
.auth-modal-content {
    padding: 2.5rem 3rem;
}

/* Modal Header */
.auth-modal-content .modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-modal-content .modal-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary, #fff);
    margin-bottom: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

.auth-modal-content .modal-header p {
    color: var(--text-secondary, #aaa);
    font-size: 0.95rem;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles (within modal - reuse from auth.css) */
.auth-modal .auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.auth-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.auth-modal .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.auth-modal .form-group label .required {
    color: var(--accent-blue, #00f0ff);
}

.auth-modal .input-wrapper {
    position: relative;
    width: 100%;
}

.auth-modal .input-wrapper i:first-child {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #666);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.auth-modal input[type="text"],
.auth-modal input[type="email"],
.auth-modal input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-input, #0d0d0d);
    border: 1px solid var(--border-color, #222);
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Password fields need extra right padding for the eye icon */
.auth-modal .input-wrapper:has(.toggle-password) input[type="password"],
.auth-modal .input-wrapper:has(.toggle-password) input[type="text"] {
    padding-right: 2.75rem !important;
}

.auth-modal input:focus {
    outline: none;
    border-color: var(--accent-blue, #00f0ff);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.auth-modal input::placeholder {
    color: var(--text-muted, #666);
}

.auth-modal .toggle-password {
    position: absolute;
    inset: 0 0 0 auto;
    width: 44px;
    background: transparent;
    border: none;
    color: var(--text-muted, #666);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal .toggle-password:hover {
    color: var(--text-primary, #fff);
}

/* Form Options */
.auth-modal .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.auth-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary, #aaa);
}

.auth-modal .checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent-blue, #00f0ff);
}

.auth-modal .checkbox-label a {
    color: var(--accent-blue, #00f0ff);
    text-decoration: none;
}

.auth-modal .checkbox-label a:hover {
    text-decoration: underline;
}

.auth-modal .forgot-link {
    color: var(--accent-blue, #00f0ff);
    text-decoration: none;
    font-size: 0.875rem;
}

.auth-modal .forgot-link:hover {
    text-decoration: underline;
}

/* Auth Button in Modal */
.auth-modal .btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue, #00f0ff), var(--accent-purple, #a855f7));
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.auth-modal .btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

.auth-modal .btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-modal .btn-auth i {
    transition: transform 0.3s ease;
}

.auth-modal .btn-auth:hover i {
    transform: translateX(5px);
}

/* Loading State */
.auth-modal .btn-auth.loading span {
    display: none;
}

.auth-modal .btn-auth .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-modal .btn-auth.loading .spinner {
    display: block;
}

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

/* Alert in Modal */
.auth-modal .alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.auth-modal .alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-modal .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* Auth Footer in Modal */
.auth-modal .auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #222);
}

.auth-modal .auth-footer p {
    color: var(--text-secondary, #aaa);
    font-size: 0.9rem;
}

.auth-modal .auth-footer a {
    color: var(--accent-blue, #00f0ff);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.auth-modal .auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .auth-modal-content {
        padding: 1.5rem;
    }
    
    .auth-modal .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-modal .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .account-type-toggle {
        flex-direction: column;
    }
    
    .account-type-toggle .toggle-btn {
        width: 100%;
    }
}

/* Account Type Section */
.account-type-section {
    margin-bottom: 1.5rem;
}

.account-type-section .section-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    margin-bottom: 0.75rem;
    text-align: center;
}

/* Account Type Toggle */
.account-type-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-input, #0d0d0d);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color, #222);
}

.account-type-toggle .toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-type-toggle .toggle-btn:hover {
    color: var(--text-secondary, #aaa);
}

.account-type-toggle .toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-blue, #00f0ff), var(--accent-purple, #a855f7));
    color: #000;
}

.account-type-toggle .toggle-btn i {
    font-size: 0.85rem;
}

/* Company Fields Animation */
#companyFields {
    animation: slideDown 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

#companyFields .form-group,
#companyFields .form-row {
    margin-top: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Small label text */
.form-group label small {
    color: var(--text-muted, #666);
    font-weight: 400;
}

/* Field hint text */
.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    margin-top: 0.35rem;
}

/* Scrollbar styling for modal */
.auth-modal::-webkit-scrollbar {
    width: 6px;
}

.auth-modal::-webkit-scrollbar-track {
    background: var(--bg-card, #0a0a0a);
}

.auth-modal::-webkit-scrollbar-thumb {
    background: var(--border-color, #222);
    border-radius: 3px;
}

.auth-modal::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #666);
}
