/* Authentication Modal Styling */

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 60, 52, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.auth-modal {
    background: var(--pure-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: var(--dark-green);
    margin: 0 0 10px;
    font-size: 1.8rem;
}

.auth-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-green);
    font-size: 0.9rem;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: #FAFAFA;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--dark-green);
    background: white;
    box-shadow: 0 0 0 4px rgba(26, 60, 52, 0.1);
}

/* Password input wrapper with toggle button */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    width: 100%;
    padding-right: 45px; /* Space for toggle button */
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    user-select: none;
}

.password-toggle-btn:hover {
    background: rgba(141, 163, 153, 0.1);
    color: var(--dark-green);
}

.password-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 60, 52, 0.3);
}

.auth-btn {
    background: var(--dark-green);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.auth-btn:hover {
    box-shadow: 0 6px 12px rgba(26, 60, 52, 0.2);
    transform: translateY(-1px);
}

.auth-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.google-btn {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin: 10px auto 0;
}

.google-btn:hover {
    background: #F5F5F5;
    border-color: #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-light);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--dark-green);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #2A6E5E;
    text-decoration: none;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(141, 163, 153, 0.1);
    color: var(--dark-green);
}

.auth-error {
    background: #FFEBEE;
    color: #D32F2F;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: none;
    border: 1px solid #FFCDD2;
    animation: fadeIn 0.3s ease;
}

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

/* Nav Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-points {
    background: #e8f5e9;
    padding: 6px 14px;
    border-radius: 20px;
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    gap: 6px;
    align-items: center;
    transition: all 0.3s;
}

.user-points.points-update {
    animation: pointsPulse 0.5s ease;
}

@keyframes pointsPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.logout-btn {
    background: #FFEBEE;
    color: #D32F2F;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #FFCDD2;
}

/* Password strength indicator (optional enhancement) */
.password-strength {
    margin-top: 5px;
    font-size: 0.8rem;
    display: none;
}

.password-strength.visible {
    display: block;
}

/* Loading state */
.auth-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-modal {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .google-btn {
        font-size: 0.9rem;
        padding: 10px;
    }
}